Skip to content
Goal: Architecture-level✓ Sources verified 2026-11-25Design TokensHeadless componentsStorybookMotionView Transitionsprefers-reduced-motion

Design Systems, Component Abstraction and Motion ​

A design system combines design decisions, reusable components and usage guidelines. For an engineer who does both design and front end, its value is simple: change one place and the whole product stays consistent; build a new page from existing components and it won't drift.

Core concepts ​

LayerContentsExamples
Design tokensThe smallest units of design decisions, values referred to by namecolor.status.danger, space.3, radius.md
Base componentsGeneric, domain-free componentsButton, Input, Dialog, Tooltip, Table
Domain componentsBuilt from base components, with domain meaningStatusPill, StepCard, TimelineItem
PatternsStandard solutions to a class of problemsEmpty states, error cards, confirming destructive actions
DocumentationUsage, states and accessibility notes for every componentStorybook

Headless components provide only behavior and accessibility (focus, keyboard, ARIA) with no styling. Radix UI is common in React; in Vue, Reka UI (formerly Radix Vue, since renamed). shadcn/ui adds Tailwind styling on top of Radix and copies the source into your project.

How it works ​

1. Token layers ​

LayerPurposeExample
Primitive / globalPalette and size scalesblue.500 = #3b82f6, space.4 = 16px
Semantic / aliasExpresses intent by referencing primitivescolor.bg.surface → gray.50, color.status.running → blue.500
ComponentComponent-specific, optionalbutton.primary.bg → color.action.primary

Switching themes (light/dark) only changes which primitives the semantic layer points to; component code stays the same.

In 2025-10 the W3C Design Tokens Community Group published its first stable format specification (Design Tokens Format Module 2025.10). It defines a JSON format ($value, $type, alias references and so on) for exchanging tokens between Figma plugins, Style Dictionary and other tools. How fully tools support this version is to be verified.

json
{
  "color": {
    "blue": { "500": { "$type": "color", "$value": "#3b82f6" } },
    "status": {
      "running": { "$type": "color", "$value": "{color.blue.500}" }
    }
  }
}

In code they usually become CSS custom properties:

css
:root { --color-status-running: #3b82f6; --space-3: 12px; }
[data-theme="dark"] { --color-status-running: #60a5fa; }
.status-pill[data-status="running"] { color: var(--color-status-running); }

2. Component API principles ​

PrincipleMeaning
Variants, not boolean combinations<StatusPill status="retrying" /> beats <StatusPill yellow spinning />
Composition over configurationSplit complex components into Card.Header, Card.Body (React compound components / Vue slots) instead of 20 props
Support controlled and uncontrolledvalue + onChange for controlled; defaultValue for uncontrolled
Pass through native attributesAllow className, aria-*, ref
Accessibility built inCorrect role, name and keyboard behavior by default
Cover every stateDefine default / hover / focus / active / disabled / loading / error for each component

3. What motion is for, and the rules ​

Motion should express state changes, spatial relationships and cause and effect, not decoration:

PurposeExampleSuggested duration
State changeA step goes from "running" to "done" with an icon transition150–250ms
Enter / exitA new event slides into the timeline, a drawer opens200–300ms
Draw attentionThe "needs you" banner emphasizes onceOnce, no loop
Ongoing activityA gentle pulse on the running nodeLow amplitude, can be turned off

Durations are common rules of thumb, not a standard; tune them for your product.

prefers-reduced-motion: when the user turns on "reduce motion" in their OS, the media query prefers-reduced-motion: reduce matches. Remove movement, scaling and parallax, keeping only necessary fades or instant changes. WCAG 2.3.3 (Animation from Interactions, level AAA) also asks that motion triggered by interaction can be disabled.

4. Ways to implement motion ​

ApproachGood forNotes
CSS transition / animationSimple state transitionsFirst choice, performs well; animate only transform and opacity
View Transitions APIView changes (list → detail, reordering)document.startViewTransition(); same-document view transitions became Baseline Newly available in 2025-10
Motion (formerly Framer Motion)Layout animation, gestures and exit animations in ReactRenamed to Motion; import from motion/react
Vue <Transition> / <TransitionGroup>Enter/leave and list animations in VueBuilt into Vue

In practice ​

Building a small design system from scratch ​

  1. Inventory the colors, font sizes, spacing and radii used across existing pages and merge them into scales (e.g. spacing in multiples of 4)
  2. Create two token layers: primitives + semantics; dark mode changes only the semantic layer
  3. Build 8–10 base components first: Button, Input, Select, Dialog, Tooltip, Tabs, Table, Toast, Badge, Skeleton
  4. Then domain components: StatusPill, StepCard, TimelineItem, ErrorCard, HumanRequestBanner
  5. Write Storybook stories covering every state of every component; add the a11y addon for automatic checks
  6. Write one page of guidelines: color usage, meaning of status colors, tone of copy, motion durations

Respecting reduced motion ​

css
.timeline-item { transition: transform 200ms ease, opacity 200ms ease; }
@media (prefers-reduced-motion: reduce) {
  .timeline-item { transition: opacity 120ms linear; transform: none; }
}
tsx
import { motion, useReducedMotion } from 'motion/react'

function NewEvent({ children }: { children: React.ReactNode }) {
  const reduce = useReducedMotion()
  return (
    <motion.li
      initial={reduce ? { opacity: 0 } : { opacity: 0, y: -8 }}
      animate={{ opacity: 1, y: 0 }}
      transition={{ duration: 0.2 }}
    >
      {children}
    </motion.li>
  )
}

Common pitfalls ​

  1. Tokens with only primitives: components reference blue.500 directly, so changing themes means editing everywhere.
  2. Prop explosion: one component with 30 boolean props produces many untested combinations.
  3. Copy-pasted "same name, different look" components: two slightly different Buttons, and the design system exists in name only.
  4. Animating layout properties (width, top): triggers reflow and jank. Prefer transform and opacity.
  5. Endless looping animations: constantly pull attention, disturb reading and ignore reduced-motion preferences.
  6. Dark mode as simple inversion: shadows, borders and status colors each need their own tuning to keep contrast.

Common interview questions ​

  1. Why split design tokens into primitives and semantics? How do you implement dark mode?
  2. What problem do headless components solve? How is shadcn/ui different from a traditional component library?
  3. How would you design the API of a StatusPill or Table component?
  4. What is motion for in tool products? Where shouldn't you add it?
  5. How do you use prefers-reduced-motion?
  6. Why animate transform and opacity first?
  • This site: themes already use CSS variables for light ("blue sky, white clouds") and dark (graphite), and there are status components such as StatusPill and ProgressBar; this article is the outline for a "design system notes" page.
  • Agent Run Console: Storybook shows every state of StatusPill, StepCard and ErrorCard; timeline insert animations and state transitions respect prefers-reduced-motion.
  • Related: Tailwind and shadcn/ui.

Sources ​

Vin Amory · AI development × content creation · Technical notes cite official docs in each page’s sources section