Skinning Control UI
Author complete token-driven Control UI skins with slots, adornments, motion controls, and one shared component source.
Not sure a skin is even the right tool? The customization ladder in the Architecture guide places every “make it different” request on one of eight rungs — with what each rung costs an app that never uses it. This page picks up once the answer is a skin.
Where skin values live
One owner for each visual decision.
The token contract
Every custom property a skin may re-value, rendered straight from lib/theme-contract.ts — the same module the coverage test enforces, so this reference can never drift from the CSS.
| Token | Group | Description |
|---|---|---|
--background | Color | Base surface color (panels, bubbles read it via bg-background). |
--foreground | Color | Default text color on --background. |
--card | Color | Card surface; sits on --background in light, one ramp step above it in dark. |
--card-foreground | Color | Text color on --card. |
--popover | Color | Floating surface base (popover / menu / select / dialog). |
--popover-foreground | Color | Text color on --popover. |
--primary | Color | THE brand color; primary action surfaces route through it. |
--primary-foreground | Color | Text color on --primary. |
--muted | Color | Subdued fill for quiet surfaces. |
--muted-foreground | Color | Secondary / meta text color. |
--secondary | Color | Secondary action fill (assistant bubble in chat skins). |
--secondary-foreground | Color | Text color on --secondary. |
--accent | Color | Hover / selection highlight fill. |
--accent-foreground | Color | Text color on --accent. |
--destructive | Color | Destructive action color. |
--destructive-foreground | Color | Text color on --destructive. |
--border | Color | Hairline border color (carries --ring-opacity). |
--ring | Color | Ring palette color; --focus-ring derives from it at 70% alpha, so a skin whose ring loses 3:1 there (a saturated accent or a softened halo) must set --focus-ring. |
--canvas | Color | The page paper the scene/panels float on; same ramp step as --background by default, skins may drop it below. |
--font-sans | Typography | Typeface for the whole UI. |
--font-mono | Typography | Monospace face (code, kbd). |
--radius | Radius | THE single radius knob; the whole scale multiplies from it. |
--duration-fast | Motion | Fast tempo for press feedback and small state transitions; frequent hover paint is instant. |
--duration-base | Motion | Base tempo (menus, indicators). |
--duration-slow | Motion | Slow tempo (panel/message entrances). |
The anatomy contract
Generated from canonical component DOM. Family is the selector key; slot names the part; scope identifies the component.
Copy a selector as [data-skin="brand"] [data-slot="shell"][data-control-family="chat-composer"]. Optional adornment anchors are listed separately in the machine-readable contract, one slice per paint family, so they cannot be mistaken for DOM parts.
Skin requirements — the do-not list
What a pack must and must not do. Every rule is enforced by a test, so a violating pack fails the build before it ships.
Adornments
JSX at named anchors — decorative chrome, or behavioral fx layers.
Additive, render zero DOM when absent, never gate library behavior. Decorative anchors (window titlebars, window controls) take plain aria-hidden JSX. Behavioral anchors (like chat-composer:send-layer) take a (ctx) => JSX render prop whose ctx carries plain render-time values — this is how a pack activates an anchored extension (send-aurora). Adornments are nested by scope and part in skin.config. Interactive values live in a separate "use client" file the pack ships, so skin.config itself stays RSC-pure.
Motion flag
One config field, nothing to wire.
motion: "reduced" stamps data-motion="reduced", which collapses --duration-fast/base/slow to 0 — every cva transition, Base UI enter/exit and the shimmer/ripple keyframes flatten at once. SkinProvider stamps it on the root when the skin is installed on <html data-skin>; a wrapper scope gets it from skinScopeAttributes(skin). The theme editor also exposes a manual “Reduce motion” toggle.
Component knobs and the cascade
Tokens theme the whole app from :root. Knobs theme one family and live on its root element — every slot inherits.
/* app-wide: a token, on :root */:root { --radius-field: 0.75rem; }
/* one family, everywhere: a knob, on the family root */[data-control-family="chat-composer"] { --cui-chat-composer-shell-radius: 0; }
/* one instance, on the root element: className="[--cui-chat-composer-shell-radius:0]" or style={{ "--cui-chat-composer-shell-radius": "0" }} */The recipe declares each knob’s default on the family root at zero specificity, so a value set on that element always wins: style beats a skin, a skin beats the recipe, a utility class beats both. Setting a knob on :root does nothing — the family root re-declares it; re-value the token it derives from instead. Portaled surfaces are their own root: set --popup-* on the popup content, not on the trigger. Each component page lists its knobs with type and default.
Skins
Each pack’s tokens, skin.css and config, ready to read and install.
Mastra Playground UI: Mona Sans and Commit Mono, compact pill controls, neutral inverse actions, quiet navigation, inset badges, and layered surfaces.
Craft-inspired neutral surfaces, Inter typography, pill controls, and quiet layered shadows.
Windows XP Luna with compact system typography, glossy controls, blue window frames, and Explorer task panes.
Classic Windows 98 with bitmap system typography, raised gray controls, recessed fields, navy title bars, and Explorer tree navigation. Fixed to its original light palette.
Polished metal skin with a WebGL shader control surface.
Brutalist skin with coral accents, squared corners, and dense typography.
Hand-drawn pencil outlines, Excalifont handwriting, and neutral paper surfaces. A clean sketchbook for prototypes and everyday interfaces.
Control UI defaults: neutral colors, square corners, and no shadows. No skin required.
macOS 27 Liquid Glass: SF Pro at 13px, 24px regular controls, accent-filled selection, frosted glass menus and popovers, and an edge-attached sidebar.
Cuicui-inspired shell skin with fixed grain, a docked w-80 sidebar, a neutral main container, and the send-aurora anchored extension on ChatComposer (skin.config fills the chat-composer:send-layer anchor).
Linear's measured design language: indigo on a cool neutral ramp, a 12/13px chrome band at weight 450/500, pill buttons with half-pixel rims, 8px fields on 12px panels, and 32px menu rows inset in a 6px gutter.