A token-driven React design system built with Tailwind CSS and Storybook.
Chromatic: https://www.chromatic.com/library?appId=6926011827ed83ffed72ba54
This repository is both:
- A working design system used to build components consistently
- A reference implementation you can adapt to create your own design system
The detailed architecture and component guidance lives in packages/design-kit/README.md.
- Node.js 20+
- npm 10+
npm install
npm run devnpm run storybookpackages/design-kit/tokens/design.tokens.ts: source of truth for design valuespackages/design-kit/styles/theme.css: CSS variables used by semantic theme tokenstailwind.config.js: maps tokens and semantic values into Tailwind utilitiespackages/design-kit/atoms: primitive componentspackages/design-kit/components: composed componentspackages/design-kit/utils/build-tokens.ts: token build pipeline
- Define base values in
design.tokens.ts - Build/generate token outputs (
npm run build:tokens) - Tailwind exposes utilities from those tokens
- Components consume Tailwind classes (
p-4,rounded-lg,bg-bg-primary) - Theme variables in CSS control semantic colors at runtime
- Update tokens first when adding/changing spacing, type, colors, radius, shadows, or breakpoints.
- Use semantic color classes (
bg-bg-primary,text-text-primary) for theme-aware UI. - Use direct/base palette classes only when values should remain static.
- Build and run Storybook to validate visual and interaction behavior.
- Keep component examples/stories in sync with token or API changes.
npm run dev # Build tokens and run app
npm run build:tokens # Rebuild token outputs
npm run storybook # Start Storybook
npm run build # Production build
npm run build-storybook # Static Storybook buildIf you want to build your own system inspired by this repo, copy the operating model rather than component details:
- Establish one token source of truth (
design.tokens.tsequivalent). - Separate base primitives from semantic theme tokens.
- Map tokens to utility classes (Tailwind or your preferred styling layer).
- Keep components declarative and token-consumptive, not hardcoded.
- Add Storybook from day one for visual documentation and regression checks.
- Automate token build steps so all consumers stay in sync.
- Fork this repository.
- Replace token scales (spacing, type, color, radius) with your brand language.
- Replace semantic theme values in theme CSS files.
- Keep the same token -> styling config -> component pipeline.
- Add your domain components on top of atoms.
- Single source of truth for design decisions
- Semantic tokens for theming flexibility
- Utility-first implementation with token alignment
- Reusable primitives before composed patterns
- Documented UI via Storybook + Chromatic
packages/design-kit/README.md: detailed architecture and component-level guidancepackages/design-kit/tokens/design.tokens.ts: token definitions