Case study · Design system · React component library

SagUI

A React design system with motion built in — tokens, 60+ components, Storybook, a docs site, and an MCP server so AI tools build with the system instead of around it.

DESIGN SYSTEMDESIGN TOKENSMOTIONACCESSIBILITYAI-READY
RoleDesign Systems Lead & Design-Engineer
Statusv0.1 — in active development
StackReact · Radix · CVA · Motion · Tailwind v4 · Storybook 10 · Next.js · Changesets
Timeline2026

69

Components across inputs, overlays, data and charts

12

Chart types driven by a four-colour token palette

2

Themes — every component checked for a11y in both

1

MCP endpoint so AI agents look up real props

Overview

SagUI is a design system I built as a single npm-workspaces monorepo: @sagui/tokens for semantic colour, type, radius, elevation and motion; @sagui/ui for the React components; a Storybook deployed to GitHub Pages; and a Next.js docs site on Vercel.

Its defining idea is that motion is part of the system, not decoration added per screen. Springs, durations and easing are tokens, every component ships with its motion already tuned, and all of it respects prefers-reduced-motion.

01 · The problem

Most component libraries stop at static states. Teams then hand-roll transitions screen by screen, timings drift, dark mode breaks where someone hard-coded a colour, and AI coding tools — now writing a large share of UI — invent props that don't exist.

The SagUI docs homepage: '69 components · open source' and the headline 'Interfaces that move with intent.' with Explore components and Give SagUI to your AI buttons
The docs site — install from npm, or point an AI tool at the docs and let it build.
The goal: a system where the right choice is the easy one — for designers, developers, and the agents working alongside them.

02 · Foundations & tokens

Everything starts in @sagui/tokens. Components never reference raw values; they reference roles, so a theme swap or a rebrand is a token change.

01

Semantic colour, light + dark

Role-based colours (surface, ink, border-strong, success, warning, danger) with dark mode toggled by a single data-theme attribute on <html>.

02

Type scale with roles

An explicit type scale with tracking on the large steps, exposed as type-* role utilities so headings and labels stay consistent.

03

Radius & elevation roles

Radius roles (control, container, overlay, pill) and five elevation levels, with theme-aware shadows that get denser in dark mode.

04

Motion as tokens

Spring and ease presets plus duration tokens (instant → considered). Components pick a role, not a millisecond value.

Storybook's Colors foundation page showing semantic colour tokens such as --color-background, --color-primary and --color-destructive, with Foundations, Components and Charts in the sidebar
Foundations in Storybook — components only reference semantic tokens.

03 · Component library

Components are built on Radix primitives for behaviour and accessibility, CVA for variants, Motion for animation, and Tailwind v4 for styling. They were shipped in families so each set shares patterns.

01

Buttons

Button, ActionButton, SplitButton, ButtonGroup, CopyButton and ConfirmMorph — labels morph, loading keeps focus.

02

Inputs & selection

Input, PasswordStrength, MoneyInput, PhoneInput, TagInput, Combobox, MultiSelect, MorphSelect, RadioCards, SegmentedControl.

03

Messages & overlays

Alert, Toast, Dialog, Drawer, BottomSheet, Popover, and a Tooltip that crossfades text and resizes on a spring.

04

Data & charts

MetricCard, SortableDataTable, Timeline, and 12 charts — line, bar, donut, gauge, streamgraph, waffle, slope, heatmap, ridgeline, treemap.

05

App shell

An original AppShell: sidebar that folds to an icon rail (⌘/Ctrl + B), becomes a drawer under 1024px, plus an inset variant.

06

Text & motion effects

TextReveal, InViewTitle, TextMorph and TextShimmer for considered, reduced-motion-safe emphasis.

04 · Quality bar

Every component passes the same checklist before it ships. The checklist is the definition of done, not an aspiration.

  • CVA variants and sizes, with focus, disabled and loading states
  • Reduced-motion behaviour defined, not left to chance
  • Stories for default, variants, sizes and states
  • Passes the Storybook a11y addon in both light and dark themes
  • A changeset describing the change for versioned releases

05 · Docs that can't drift

Component pages are written in Markdown with live demos marked inline. Each demo is defined once in a source file between region markers, and the docs' Code tab renders that same source — so the example a reader copies is exactly the one running on the page.

01

Single source for demo and code

Demos live in <slug>.demos.tsx; Markdown references them by name. No pasted snippets to fall out of date.

02

Versioned releases

Changesets drive a Release workflow that opens a version PR and publishes to npm. CI builds Storybook to GitHub Pages.

The Button docs page: a live Preview and Code tab showing Continue, Save draft, Cancel, Skip and Delete buttons, followed by When to use and When not to use guidance
Every component page opens on a live demo; the Code tab renders the same source.

06 · Built for AI-assisted teams

A design system is only useful if it's what actually gets used. With so much UI now written with AI, SagUI exposes itself to agents directly.

01

Hosted MCP server

The docs site serves an MCP endpoint, so tools like Claude look up real components and documented props instead of guessing.

02

Storybook MCP

Stories are queryable by agents too, giving them variants and states to reference while building.

03

Project skill

A sagui-sales-analytics skill encodes the rules — SagUI component first, documented props only, tokens only, both themes, accessible by default.

The system's guardrails travel with the code — whether a person or an agent is writing it.

07 · Proven in a real product

SagUI was validated by building a full Sales Analytics dashboard entirely on it, installed as a packaged dependency outside the monorepo. That surfaced real gaps — bundling motion tokens for external apps, dark-theme rules dropped by the browser — which were fixed back in the system.

The Sales Analytics dashboard built on SagUI: KPI cards for revenue, units, margin and open alerts above a revenue trend chart
Sales Analytics — AppShell, MetricCard and LineChart straight from SagUI.
Read the Sales Analytics case study →

The button, input and several data components are ports of the free, open-source components from Arc (uiarc.dev), rebuilt on SagUI's Tailwind and token layer.

← Back to portfolio