Building a Design System from Scratch
Design Systems · UI/UX

Building a Design System from Scratch

Author Manav Tyagi
Published Feb 18, 2026
Read Time 14 min read

A design system isn't just a Figma library — it's the single source of truth that keeps your product consistent, your team aligned, and your velocity high. Here's how to build one that actually works, based on real-world experience.

The Foundation

Why Build a Design System?

Key Insight: Companies like Airbnb, Shopify, and Google have publicly credited their design systems with reducing design-to-dev handoff time by 30–50%. The investment pays for itself within months.

Step 01

Audit Your Existing UI

  • Visual Inventory
    Screenshot every unique UI element across all screens. Group them by type: buttons, inputs, cards, navigation, modals, typography, etc. Tools like Figma's "Select All with Same Properties" make this faster.
  • Code Audit
    Work with your developers to grep the codebase for duplicate CSS classes, inline styles, and inconsistent component implementations. This reveals the gap between design intent and what actually shipped.
  • Usage Frequency
    Rank components by how often they appear. A button that shows up on every page is higher priority than a specialty chart widget used once. Focus your system on the 20% of components that cover 80% of use cases.
Step 02

Define Your Design Tokens

Token Category Example Variable Example Value
Color — Brand --color-primary #6366f1 (Indigo 500)
Color — Neutral --color-gray-900 #0f172a (Slate 900)
Spacing --space-4 16px (base × 4)
Typography --font-heading 'Inter', sans-serif
Shadows --shadow-md 0 4px 6px rgba(0,0,0,.1)
Border Radius --radius-lg 12px
Motion --ease-out cubic-bezier(0,.6,.4,1)

Pro Tip: Use a layered token architecture. Define global tokens (raw values), then map them to semantic tokens (like --color-surface, --color-on-surface). This makes dark mode and theming trivially easy.

Step 03

Build Your Typography Scale

Heading Styles

  • Display: 48px / 700 weight — hero sections
  • H1: 40px / 700 weight — page titles
  • H2: 32px / 600 weight — section headers
  • H3: 24px / 600 weight — subsections
  • H4: 20px / 600 weight — card titles

Body & Utility Styles

  • Body Large: 18px / 400 — long-form reading
  • Body: 16px / 400 — default body text
  • Body Small: 14px / 400 — secondary info
  • Caption: 12px / 500 — labels, metadata
  • Overline: 11px / 700 uppercase — eyebrows
Step 04

Design Your Component Architecture

  • Atoms → Molecules → Organisms
    Follow Brad Frost's Atomic Design methodology. Start with atoms (icons, labels, color swatches), combine them into molecules (an input with a label and icon), then assemble organisms (a full search bar with filters). This hierarchy prevents bloat.
  • Variants & States
    Every component needs defined variants (primary, secondary, ghost, danger) and states (default, hover, focus, active, disabled, loading). Document all permutations. A button isn't "done" until every combination is accounted for.
  • Slot-Based Composition
    Design components with "slots" — configurable areas where content can change. A card component should have slots for header, media, body, and actions. This makes components flexible without creating dozens of frozen variants.
  • Accessibility Built-In
    Bake accessibility into every component from day one. Focus states, ARIA labels, keyboard navigation, and color contrast ratios (WCAG AA minimum of 4.5:1) should not be afterthoughts — they should be requirements for every component to be marked "complete."
Component Variants States Priority
Button Primary, Secondary, Ghost, Danger, Icon-only Default, Hover, Focus, Active, Disabled, Loading 🔴 Critical
Input Text, Password, Search, Textarea Empty, Filled, Focus, Error, Disabled 🔴 Critical
Card Default, Elevated, Outlined, Interactive Default, Hover, Selected 🟡 High
Modal Alert, Confirmation, Form, Full-screen Open, Closing (animation) 🟡 High
Navigation Top bar, Side nav, Bottom nav, Breadcrumb Default, Active, Collapsed 🟡 High
Toast / Snackbar Success, Error, Warning, Info Entering, Visible, Dismissing 🟢 Medium
Step 05

Document Everything (Seriously)

What to Document

  • Usage: When and why to use this component
  • Anatomy: Labeled diagram of each part
  • Variants: All visual options with examples
  • Do's & Don'ts: Real examples of correct vs incorrect usage
  • Code Snippet: Copy-paste implementation

Documentation Tools

  • Storybook: Industry standard for component docs
  • Zeroheight: Connects directly to Figma
  • Notion / GitBook: Lightweight, fast to set up
  • Supernova: Auto-generates docs from design files
  • Custom site: Full control, best for large orgs

Real Talk: I've seen beautifully designed component libraries die because nobody documented how to use them. Write the docs as you build — not after. If a component isn't documented, it doesn't exist.

Step 06

Bridge Design & Code

A design system only works if design and code stay in sync. The Figma component and the React/HTML component must be mirrors of each other. Here's how to maintain that bridge without losing your mind.

  • Token Export Pipeline
    Use tools like Tokens Studio for Figma to export design tokens as JSON. Then transform them into CSS custom properties, SCSS variables, or JavaScript constants using Style Dictionary. Automate this with a CI/CD pipeline so token changes propagate automatically.
  • Naming Parity
    Use identical names in Figma and code. If your Figma component is called "Button/Primary/Large," your code should export <Button variant="primary" size="large" />. Naming mismatches are the #1 source of design-dev friction.
  • Visual Regression Testing
    Use tools like Chromatic or Percy to automatically screenshot every component state after each code change. If a pixel shifts unexpectedly, you'll catch it before it reaches production. This is your safety net against design drift.

Key Insight: The best design systems treat components as products, not libraries. They have versioning (v1.2.0), changelogs, deprecation notices, and migration guides — just like any software dependency.

Step 07

Governance & Scaling

Governance Area What It Means How to Implement
Contribution Model Who can add/modify components? Federated model — teams propose, DS team reviews
Versioning How do you track changes? Semantic versioning (major.minor.patch)
Deprecation How do you retire old patterns? 6-month notice period with migration guides
Adoption Metrics Is the system actually being used? Track component usage via analytics or lint rules
Office Hours How do teams get help? Weekly DS office hours + Slack channel
Pitfalls

Common Mistakes to Avoid

  • Building Too Much, Too Fast
    Don't try to design 200 components before shipping anything. Start with the top 10 most-used components, get them adopted, then iterate. A small, well-adopted system beats a large, unused one every time.
  • Designing in Isolation
    A design system built without developer input is doomed. Involve engineers from day one. They'll tell you what's feasible, what's expensive, and what naming conventions match the codebase. Design systems are a team sport.
  • No Escape Hatches
    Rigid systems create resentment. Provide well-documented ways to override, extend, or compose beyond the system when edge cases arise. The goal is consistency, not uniformity — there's a difference.
  • Ignoring Dark Mode & Theming
    If you hard-code hex colors instead of using semantic tokens, adding dark mode later becomes a nightmare rewrite. Build the token architecture for theming from the start, even if you only ship one theme initially.

My Take: The Real Payoff

I built the design system behind this very portfolio site. Every color (--neon, --surface-glass), every spacing value, every component (cards, buttons, navigation) follows a documented system. And here's what I learned:

  • Speed compounds: The more components I added, the faster new pages came together. My blog template now takes 30 minutes instead of 3 hours.
  • Consistency builds trust: Visitors subconsciously notice when every button behaves the same, every shadow feels familiar, every animation follows the same easing curve. It feels "professional" even if they can't articulate why.
  • It's never "done": A design system is a living product. I'm still tweaking token values, adding component variants, and improving documentation. And that's the point — it grows with your product.

If you're a UI/UX designer who hasn't built a design system yet, start small. Pick your top 5 components, define your tokens, document them, and iterate. The compound effect of a well-maintained system will transform how you design.