All postsEngineering

React Component Library with Design Tokens: A Practical Architecture

A practical architecture for combining a React component library with design tokens, component docs, and AI-ready metadata using Fragments.

This article covers the reusable @usefragments/* packages. Fragments desktop is the main app for directing frontend work; you can use the packages independently.

A React component library with design tokens should do more than centralize colors and spacing. It should give your team a repeatable architecture for component APIs, usage guidance, and theming decisions that can survive rapid iteration and AI-assisted development.

Fragments combines these concerns into one workflow.

What the Architecture Needs to Support

A practical architecture should support:

  • component-level docs with examples and props
  • token-driven styling and theming
  • a way to keep AI-written code on the real component system

Fragments covers those layers with the components docs, the @usefragments/ui package, and checks in the desktop app.

How Fragments Connects Components and Tokens

Fragments uses seed-based theming to derive design tokens and applies them across the component library. That means visual updates propagate consistently instead of relying on one-off overrides.

Use Getting Started to wire the library into your React app, then tune the token system through its seed values.

FAQ

Are design tokens enough to keep UI consistent?

No. Tokens solve visual consistency, but you also need component usage guidance and documented patterns.

Why include AI tooling in the architecture?

Because AI is now part of many teams' implementation workflow. If nothing holds it to your real system, it will guess.

Next steps

Start with the components docs. When your team wants AI to build against the same system, join the waitlist for the Fragments desktop app.

Keep exploring