Skip to main content

Themes and environment

Theme supplies scoped tokens; Direction supplies logical direction. Host appearance, text scaling, and reduced motion still affect rendering.

Token families​

FamilyValues / bounds
colorsHex #RRGGBB / #RRGGBBAA, or light/dark variants
radiiFinite 0–256 logical units
fontsFinite 8–256 logical units
recipesBase/control-state presentation assignments

Token names are lowercase letters/digits/hyphens, begin with a lowercase letter, and are at most 64 characters. Each dictionary allows at most 128 entries.

Example​

<Theme bind-tokens="{colors:{'rc-brand':{light:'#165C43',dark:'#8FE3BC'}}}">
<Text text="Scoped color" class="text-rc-brand" />
</Theme>

Default native palette​

Native defaults use Tailwind’s color palette: zinc for backgrounds, surfaces, text, and borders; blue for interactive emphasis; red for destructive actions; green for success; and amber for warnings.

RoleLightDark
backgroundzinc-50zinc-950
card, surfacewhitezinc-900
accent, ringblue-600blue-400
on-accentwhiteblue-950
dangerred-600red-400
on-dangerwhitered-950
successgreen-700green-300
on-successwhitegreen-950
warningamber-700amber-300

Use padding around a card to expose the containing background. The preview canvas uses the default background role so unstyled roots and card examples stay distinct.

Native and Components roles​

Native accent / on-accent and Components rc-primary / rc-primary-foreground have separate ownership. Native primary retains its text-color meaning. Override foreground/background pairs together; aliases are not automatically linked by one-sided overrides. ui:Theme installs library colors, fonts, radii, and recipes. Unknown rc-* tokens/recipes fail validation.

Direction and policy​

<Direction value="rtl">
<Column class="ps-4"><Text text="Logical padding" /></Column>
</Direction>

Direction accepts ltr / rtl. Logical padding and inline translation follow it; physical left/right/X utilities stay physical. Scoped motion accepts system, reduced, and off and cannot force more motion than the host allows.

Styles guide · Variants · Motion policy