What is Primer Design System

Primer Design System is GitHub's component library. If you've used GitHub.com, you've seen Primer - every button, form, and input field uses these components.

Primer exists because GitHub got tired of their UI looking like shit across different teams. Every component follows the same patterns so you can't fuck up the interface. It's their internal system made public, which means you get components that have been stress-tested by 100+ million developers doing weird stuff you never thought of.

How Primer is Split Up

Primer has three parts because GitHub learned the hard way that one-size-fits-all design systems are bullshit:

Primer Product UI - 50+ React components for building actual applications. Current version is around v37. Components like ActionList, TreeView, and DataTable that don't completely shit themselves when you're displaying thousands of repository entries.

Primer Brand UI - Marketing site components because using product components for landing pages makes everything look like a developer tool. Nobody wants their marketing site to look like a GitHub issue tracker.

Octicons - 300+ icons designed for developer workflows. These aren't generic icons - they cover things like merge conflicts and CI status that regular icon libraries ignore.

The CSS Modules Migration That Actually Mattered

Version 37 ditched styled-components for CSS Modules, which was huge. GitHub wasn't following trends - their engineering team was pissed about bundle size bloat and shitty runtime performance.

What they fixed:

  • Bundle sizes got ~30% smaller
  • No more runtime CSS generation killing page loads
  • Build times stopped sucking
  • CSS debugging that doesn't make you want to quit

The dependencies now:

  • @primer/react - Main components
  • @primer/primitives - Design tokens
  • styled-components@5.x - Legacy shit they're trying to kill

Revolutionary concept, I know - only took the industry 10 years to figure out designers and devs should use the same specs.

Why Primer is Different

Most design systems are academic bullshit. Primer runs GitHub.com, which means 100+ million developers use it daily. When a Primer component breaks, it breaks for more developers than most companies will ever see.

Real-world edge cases it handles:

  • File trees with 10,000+ files (try that with Material-UI)
  • Code review threads that span months
  • Repository settings with hundreds of options
  • Notification feeds processing thousands of events daily

Companies like OpenProject migrated specifically because it's battle-tested. When your design system survives GitHub's scale, you know it won't shit itself the moment you hit production traffic.

Primer Design System Forms

GitHub Design System Architecture

Primer vs Other Component Libraries

Feature

Primer

Material-UI

Ant Design

Bootstrap

Current Version

v37.x

v6.x

v5.x

v5.x

Components

50+

70+

60+

20+

Bundle Size (min+gzip)

~45KB

~87KB

~120KB

~25KB

TypeScript

✅ Built-in

✅ Built-in

✅ Built-in

❌ External

Design Tokens

✅ @primer/primitives

✅ Theme system

✅ Less variables

❌ CSS variables

Dark Mode

✅ Works well

✅ Works well

✅ Works well

❌ Do it yourself

Accessibility

✅ WCAG 2.1 AA

✅ WCAG 2.1 AA

✅ WCAG 2.0 AA

❌ Barely

Figma Library

✅ Official

❌ Community

✅ Official

❌ Third-party

CSS Architecture

CSS Modules

Emotion/styled

CSS-in-JS

CSS classes

Tree Shaking

✅ Good

✅ Good

✅ Good

❌ Shit

Mobile Support

✅ Responsive

✅ Responsive

✅ Responsive

✅ Responsive

Testing

Jest + RTL

Jest + RTL

Jest + RTL

Manual

Community Size

3.6k stars

94k stars

92k stars

170k stars

Best For

Developer tools

Google-style apps

Enterprise dashboards

Quick prototypes

Implementation Reality

Getting Started - What They Don't Tell You

Primer setup is pretty straightforward, but there are gotchas:

npm install @primer/react @primer/primitives styled-components@5.x

Three packages, but styled-components is legacy shit they're trying to phase out. You'll get deprecation warnings. React 18+ works fine, but if you're stuck on 17, you'll need the compatibility layer and some patience.

Minimal setup:

import '@primer/primitives/dist/css/functional/themes/light.css'
import {BaseStyles, ThemeProvider, Button} from '@primer/react'

function App() {
  return (
    <ThemeProvider>
      <BaseStyles>
        <Button>This actually works</Button>
      </BaseStyles>
    </ThemeProvider>
  )
}

Critical gotcha: ThemeProvider must wrap your entire app or random components will render with broken styles. Learned that the hard way debugging why buttons looked fucked up.

The CSS Modules Migration - Performance Reality

Version 37 ditched styled-components because GitHub's team was dealing with real performance problems in production:

Before (styled-components hell):

  • Runtime CSS generation killed initial page loads
  • Bundle sizes bloated because tree-shaking was shit
  • Debugging dynamic styles made you want to quit engineering
  • Build times got progressively worse

After (CSS Modules):

  • CSS processes at build time (much faster)
  • ~30% smaller bundles in most real apps
  • Tree-shaking that actually works
  • CSS debugging that doesn't make you hate your life

Bundle size reality check: That 45KB is optimistic. Import ActionList, DataTable, and Dialog and you're looking at 80KB+ in real applications. Bundle analysis shows most projects import like 30% of components they never use because devs are lazy. Migration from CSS to React isn't terrible, but plan for a weekend of fixing prop names.

What They Actually Test Against

Primer gets tested against the real world because it runs GitHub.com:

  • Users with 200+ browser extensions that break CSS in weird ways
  • Corporate proxies that mangle JavaScript
  • Ancient screen readers that developers forgot exist
  • Mobile devices with 512MB RAM running browsers from 2018
  • Accessibility auditors who will fail your shit for missing aria-describedby

WCAG 2.1 AA compliance isn't marketing bullshit - GitHub gets sued if their components break screen readers. Most other design systems treat accessibility as an afterthought.

Migration Reality

Migration guides include automated codemods because GitHub updates hundreds of components across their codebase. They're not doing manual find-and-replace like savages.

Version updates follow semantic versioning. Breaking changes include:

  • Automated migration scripts (when possible)
  • Deprecation warnings with upgrade paths
  • Clear timelines (no surprise breaking changes)
  • Technical explanations of why they broke your shit

Developer Experience Reality

Figma Integration: The official Figma library actually matches the React implementation. Designers can't spec impossible component states that don't exist in code.

TypeScript Support: Built-in definitions with good autocomplete. No @types/ packages that break every time you update. TypeScript definitions mean your IDE will autocomplete props and catch your dumb mistakes before runtime - no more wondering if it's 'variant' or 'size'.

Testing: Works with Jest and React Testing Library. No weird mocking requirements or custom test utilities to learn.

The catch: Some Primer components have wonky TypeScript generics that make your IDE confused. ActionList is particularly annoying with its type definitions - expect to wrestle with generic constraints for an hour.

Primer Design System FAQ

Q

Is Primer free to use commercially?

A

Yes, MIT license. Use it however you want, modify it, ship it in commercial apps. No restrictions.

Q

What's the difference between Product UI and Brand UI?

A

Product UI is for building actual applications

  • forms, buttons, data tables. Brand UI is for marketing sites so they don't look like GitHub issue trackers. Most developers only care about Product UI.
Q

Does Primer work with Next.js and SSR?

A

Yeah, it works with Next.js and SSR. You need to configure ThemeProvider correctly for SSR or you'll get flash of unstyled content. The docs cover this but it's not obvious.

Q

How's the mobile support?

A

Components are responsive and work on mobile. GitHub.com works on mobile so Primer does too. Responsive props let you control behavior at different screen sizes.

Q

Can I customize the colors and branding?

A

Kinda. Primer supports theming through design tokens, but customization is limited compared to other systems. You can change colors and spacing, but it's designed to look like GitHub. If you need heavy customization, pick a different system.

Q

How's the accessibility?

A

WCAG 2.1 AA compliant. Screen readers work, keyboard navigation works, high contrast modes work. GitHub gets sued if accessibility breaks, so they actually give a shit about this stuff.

Q

How often do updates break stuff?

A

Primer updates every 2-4 weeks but follows semantic versioning. Breaking changes are rare and come with migration guides. GitHub uses this internally so they can't afford to constantly break their own code. They're pretty good about not breaking shit randomly.

Q

Is Primer good for enterprise apps?

A

Yeah, it powers GitHub Enterprise in Fortune 500 companies. Components handle massive data sets (100k+ files, thousands of users) and complex permissions. If it works for GitHub's enterprise customers, it'll work for yours.

Q

How's the TypeScript support?

A

Built-in TypeScript definitions with good autocomplete. Works with Webpack, Vite, CRA, and modern testing frameworks. Some components have wonky generics that confuse your IDE, but mostly solid.

Q

Primer vs Material Design?

A

Primer is for developer tools and data-heavy apps. Material Design is for consumer mobile apps. Try building a code editor with Material Design and you'll understand why GitHub made their own system. Primer excels at information-dense interfaces.

Q

What if I find bugs?

A

GitHub uses Primer in production, so bugs get fixed quickly. Their team is responsive because their own work breaks if Primer breaks. Better than design systems from companies that don't use their own components.

Q

Can I use Primer for non-GitHub-looking apps?

A

Yes, but it's gonna look like GitHub. The components are functional but have a specific developer-tool aesthetic. If you need heavy visual customization, pick something else. If you want proven functionality that works, Primer delivers.

Q

How's the bundle size in real apps?

A

The 45KB base grows fast when you add DataTable, ActionList, and Dialog. Real apps easily hit 80KB+. Tree-shaking helps but isn't perfect. GitHub.com loads fine, so performance is usually okay unless you're building a library.

Primer Resources That Actually Help

Related Tools & Recommendations

compare
Recommended

Payment Processors Are Lying About AI - Here's What Actually Works in Production

After 3 Years of Payment Processor Hell, Here's What AI Features Don't Suck

Stripe
/compare/stripe/adyen/square/paypal/checkout-com/braintree/ai-automation-features-2025
100%
tool
Similar content

Stripe Terminal React Native SDK: Overview, Features & Implementation

Dive into the Stripe Terminal React Native SDK. Discover its capabilities, explore real-world implementation insights, and find solutions for building robust pa

Stripe Terminal React Native SDK
/tool/stripe-terminal-react-native-sdk/overview
65%
tool
Similar content

Astro Overview: Static Sites, React Integration & Astro 5.0

Explore Astro, the static site generator that solves JavaScript bloat. Learn about its benefits, React integration, and the game-changing content features in As

Astro
/tool/astro/overview
45%
tool
Similar content

Next.js Overview: Features, Benefits & Next.js 15 Updates

Explore Next.js, the powerful React framework with built-in routing, SSR, and API endpoints. Understand its core benefits, when to use it, and what's new in Nex

Next.js
/tool/nextjs/overview
43%
tool
Similar content

Remix Overview: Modern React Framework for HTML Forms & Nested Routes

Finally, a React framework that remembers HTML exists

Remix
/tool/remix/overview
43%
tool
Similar content

React Production Debugging: Fix App Crashes & White Screens

Five ways React apps crash in production that'll make you question your life choices.

React
/tool/react/debugging-production-issues
41%
tool
Similar content

Apollo GraphQL Overview: Server, Client, & Getting Started Guide

Explore Apollo GraphQL's core components: Server, Client, and its ecosystem. This overview covers getting started, navigating the learning curve, and comparing

Apollo GraphQL
/tool/apollo-graphql/overview
41%
tool
Similar content

React Codemod: Automated Upgrades & Migrations for React Apps

Official collection of codemods for seamless React upgrades and migrations

React Codemod
/tool/react-codemod/overview
41%
tool
Similar content

SvelteKit Performance Optimization: Fix Slow Apps & Boost Speed

Users are bailing because your site loads like shit on mobile - here's what actually works

SvelteKit
/tool/sveltekit/performance-optimization
36%
troubleshoot
Similar content

Fix Slow Next.js Build Times: Boost Performance & Productivity

When your 20-minute builds used to take 3 minutes and you're about to lose your mind

Next.js
/troubleshoot/nextjs-slow-build-times/build-performance-optimization
33%
tool
Similar content

GraphQL Overview: Why It Exists, Features & Tools Explained

Get exactly the data you need without 15 API calls and 90% useless JSON

GraphQL
/tool/graphql/overview
33%
tool
Similar content

Turbopack: Why Switch from Webpack? Migration & Future

Explore Turbopack's benefits over Webpack, understand migration, production readiness, and its future as a standalone bundler. Essential insights for developers

Turbopack
/tool/turbopack/overview
33%
tool
Similar content

SvelteKit: Fast Web Apps & Why It Outperforms Alternatives

I'm tired of explaining to clients why their React checkout takes 5 seconds to load

SvelteKit
/tool/sveltekit/overview
33%
tool
Similar content

Vite: The Fast Build Tool - Overview, Setup & Troubleshooting

Dev server that actually starts fast, unlike Webpack

Vite
/tool/vite/overview
33%
tool
Similar content

Surviving Gatsby Plugin Hell: Maintain Abandoned Plugins in 2025

How to maintain abandoned plugins without losing your sanity (or your job)

Gatsby
/tool/gatsby/plugin-hell-survival
33%
tool
Similar content

Wagmi: React Hooks for Web3 - Simplified Development Overview

Finally, Web3 development that doesn't make you want to quit programming

Wagmi
/tool/wagmi/overview
33%
tool
Recommended

Spreedly - Don't Get Screwed by Payment Vendor Lock-in

Connect to 140+ payment gateways through one API - no more rebuilding integrations every damn time

Spreedly
/tool/spreedly/overview
33%
tool
Similar content

SvelteKit at Scale: Enterprise Deployment & Performance Issues

Discover the critical challenges of SvelteKit enterprise deployment, from performance bottlenecks with thousands of components to team scalability and framework

SvelteKit
/tool/sveltekit/enterprise-deployment-challenges
32%
compare
Recommended

Stripe vs Plaid vs Dwolla vs Yodlee - Which One Doesn't Screw You Over

Comparing: Stripe | Plaid | Dwolla | Yodlee

Stripe
/compare/stripe/plaid/dwolla/yodlee/payment-ecosystem-showdown
31%
tool
Recommended

Stripe - The Payment API That Doesn't Suck

Finally, a payment platform that won't make you want to throw your laptop out the window when debugging webhooks at 3am

Stripe
/tool/stripe/overview
31%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization