Skip to main content
  • shadcn/ui Figma Kit
  • shadcn/ui Themes
Updated 6 min read

Design system best practices for shadcn/ui

Tokens, naming, composition and states: how to keep a shadcn/ui design system consistent in Figma and in code, and usable by AI agents.

Start from tokens, not colors

A design system is a shared language, and its smallest words are tokens. In shadcn/ui, components never hard-code colors. They use semantic classes such as bg-background, bg-primary and text-muted-foreground, and each class reads a CSS variable, with light mode values in :root and dark mode values in .dark.

Name tokens by role, not by value: --primary survives a rebrand, --blue-600 does not. Keep the same names in Figma. When the primary variable in Figma and --primary in your stylesheet mean the same thing, a theme change on one side has an obvious counterpart on the other. The shadcn/ui Pro Figma kit uses exactly these names, and the /shadcnpro-import-variables Agent Skill writes Figma variables into your stylesheet.

Give everything one name

Handoff breaks when the same thing has two names. If the Figma component is called Button, the code component should be <Button>, and its variants and sizes should match the props: variant="outline" in code, Outline in Figma.

Name layers too. “PricingSection” tells a developer, and an AI agent, far more than “Frame 47”. The /shadcnpro-generate-code Agent Skill reads layer names and structure when it turns a frame into code, so clear names give better code.

Compose instead of forking

Build bigger patterns from smaller ones. Field, Label and Input make a form row, Card and Button make a pricing tier, and a few tiers make a pricing section. With shadcn/ui you own the component source, so change it in place instead of wrapping it in layers of overrides.

In Figma, use Slots and nested components so content can be swapped without detaching. When the same section shows up across products, make it a block: a ready-made section that designers and developers both reuse.

Design every state and mode

Most visual bugs live in states nobody designed. Cover default, hover, focus, active, disabled and error for every interactive component, and loading and empty states for anything that shows data.

Check every screen in light and dark mode, and at desktop, tablet and mobile widths. With semantic tokens, dark mode is a set of values rather than a redesign.

Make the system readable for AI agents

AI editors now write a large share of interface code. They do it well when the system is explicit and badly when it is implied. Give agents the real catalog instead of letting them guess: with the shadcn/ui Pro MCP server connected, Cursor, Claude Code or VS Code search the blocks by what they do and install real ones with the shadcn CLI, instead of generating lookalikes.

The rules that help people help agents too: semantic tokens, consistent names, and a components.json that tells the CLI where everything lives.

Keep design and code in step

Document decisions, not only components: why spacing steps by 4px, when to use the destructive variant. Those notes let the next person extend the system without breaking its logic.

Treat updates as reviews. The shadcn/ui Pro Figma kit is updated every Monday, and opening a new copy leaves your working file untouched, so you decide what to bring over. In code, installed blocks never change on their own: run npx shadcn@latest add @shadcnpro/pricing-01 --diff to see what changed in a block before you overwrite your copy.

Ship your next project 10x faster, forever

4.9 out of 5Avg rating
Trusted by 13,000+designers and developers
7-day free trialCancel anytime