Skip to content
Control UIalpha
Guide

Create a skin

Re-value the token contract over an installed pack, or own a full pack of three files, then reach the component knobs beneath.

Start with the defaults

Control UI renders without a skin. Core owns a complete neutral token baseline in light and dark modes. Your application owns its theme: override shared tokens, then use component knobs for specific treatments.

Re-value application tokens

Override tokens in your own CSS after the library imports. With no provider, root tokens also reach portalled surfaces.

These overrides survive component updates because they belong to your application. You only need to declare the values that differ from the library defaults.

Retint a color ramp

Neutral, primary, and seven hues each derive a twelve-step ramp from one seed. Steps keep their job in both modes, so a seed needs one declaration, not a light and a dark pair. Every role that aliases the ramp follows: retinting red repaints red badges, and retinting green repaints success text.

Override a role instead when one surface should leave its ramp: --badge-red-foreground or --success-text. Recipes read roles only, so steps are yours to reference in application CSS. See every ramp and role live on Foundations.

Add an optional skin

A named skin can own skin-theme.css for tokens, skin.css for component knobs, and skin.config.tsx for behavior choices and adornments. Refined and the other registry presets are examples you can install and edit.

Import the installed skin-theme.css and skin.css after core and recipe CSS. Supply the config through the provider in a client module, so configurations containing render functions remain inside the client boundary, and spread skinScopeAttributes(skin) on the element that scopes the skin:

skinScopeAttributes writes data-skin, plus data-effects and data-motion when the config declares effects or motion: "reduced", so the wrapper never drifts from the config. The CSS selector and provider id must agree. A portalled popover, dialog, or menu receives that same id. Each provider scopes its own subtree; omitting a provider uses the neutral defaults and root theme.

When the skin is installed on the document instead, with <html data-skin="acme">, SkinProvider applies motion and colorScheme to the root itself and there is nothing else to wire. colorScheme is root-only: the page mode is the root dark class, so a nested scope cannot be light under a dark page. A skin with a fixed colorScheme holds that mode for as long as its provider is mounted and overrides the application's theme toggle, so hide the toggle for such a skin.

Set scrollAreaScrollbarVisibility: "always" and scrollAreaScrollbarGutter: "stable" in the skin config for persistent scrollbar tracks that reserve layout space, as in Windows XP. ScrollArea's scrollbarVisibility and scrollbarGutter props override these defaults for individual instances. The neutral defaults are "hover" and "auto", which use overlay scrollbars. Set scrollAreaScrollbarButtons: true for arrow buttons at both ends of each track that step the content and repeat while held, also as in Windows XP; the scrollbarButtons prop overrides it per instance.

Set selectAlignItemWithTrigger: true to open Select menus over the trigger with the selected item aligned to it, as macOS pop-up buttons do. SelectContent's alignItemWithTrigger prop overrides it per instance; the neutral default opens the menu below the trigger.

Set calendarShowOutsideDays: false to leave days from neighboring months blank, as Linear's date picker does. Calendar's showOutsideDays prop overrides it per instance; the neutral default shows them.

ButtonGroup frames its buttons by default: segments drop their own rim and elevation, and the group draws one frame with hairline seams from --cui-button-group-radius, --cui-button-group-shadow, and --cui-button-group-separator-color. Set buttonGroupJoin: "overlap" when each button is a self-contained object, such as a bevel or a hand-drawn outline, so grouped buttons keep their own paint and share overlapping edges, as Windows 98 does.

Set indicators to choose how selection and hover are drawn per family. sidebar and tree accept a selection indicator; sidebar, button-group, toggle-group, checkbox-group, and radio-group accept a hover indicator. Each component's own indicator prop overrides the skin default for one instance.

The example packs resolve the required token contract explicitly so each has a complete, independent appearance. A consumer theme may inherit defaults and override only the values it needs.

Go deeper with component knobs

When shared tokens cannot express a treatment, re-value the registered --cui-* knobs in your CSS.

Every knob's name, syntax, initial value, and recipe default appear in its family's /r/contract/ file. Re-value knobs at family roots so their parts inherit the treatment.

Paint a state through its state knob, such as -hover-, -active-, or -floating-, declared on the family root. Do not re-value a base knob inside a :hover or [data-state] selector: the recipe already reads the state knob there, so the override either does nothing or erases the state paint of a variant.

Shadow knobs are composed into one box-shadow list with rings and insets. Remove a shadow with 0 0 transparent, never none: none is not a valid list member and discards the whole declaration.

Browser tabs and their connected content share --cui-tabs-surface-background, --cui-tabs-surface-radius, and the tabs border knobs. Use TabsSurface around content when wrappers separate the list from its panels, and embed a Code with chrome="embedded" so it uses that surface. --cui-tabs-indicator-background styles segmented tabs; changing it does not split the connected browser surface.

Nested buttons and fields derive their default corner from the containing surface's radius, border, and padding. Their --cui-button-radius and --cui-field-radius knobs remain authoritative: setting one explicitly overrides that fitted default, including inside a composer. A circle-shaped button also keeps its circular shape. When a skin changes its control default, use var(--nest-radius, <skin-radius>) as the knob value to retain the container's fitted corner inside composed controls. To change a corner, re-value the radius and padding knobs it is computed from, such as --cui-popup-command-padding. Writing padding on the part directly, or re-valuing a computed token like --radius-popover, breaks the nesting: bun run validate rejects both. The composer uses --radius-composer and --composer-padding; --radius-field controls message bubbles.