Design tokens

Design token reference

A standalone map of the global --zui-* CSS variable contract with architecture notes, a live token playground, and copyable theme presets for brand, surface, status, and palette overrides.

Unique variables

100

Components

67

Dark variables

49

Contract pattern

Token naming

Every global token keeps the same --zui- prefix as component-level variables. Light and dark values are separate CSS variables so consumers can override either theme without changing component code.

--zui-<component>-<slot?>-<variant?>-<property>-<state?>-dark?

Architecture

How the --zui-* contract resolves

Zentauri UI keeps theme control in CSS variables instead of compiled CSS. Components read the most specific variable first, then fall back to shared globals, then to a literal value in the class string.

Global layer

--zui-brand

Brand, foreground, surface, border, status, focus, shadow, radius, and palette variables live on :root and .dark.

Component layer

--zui-button-default-bg

Each component reads component-scoped variables first, so one product surface can tune a slot without changing the global theme.

Fallback layer

var(--zui-brand,#2563eb)

Every Tailwind arbitrary value includes a hardcoded fallback, which keeps components rendered before a consumer writes any overrides.

Playground

Preview appearances and copy variables

Switch presets to see how global and component-level tokens change multiple UI primitives at once. Copy the generated CSS into your app theme and trim any variables you do not need.

Token contract layers

  1. 1. Global variables define brand, surfaces, borders, and states.
  2. 2. Component variables can override a specific slot or appearance.
  3. 3. Hardcoded fallbacks keep every component rendered without setup.

Buttons

Badge

Theme: OceanToken ready

Checkbox

Radio group

Dropdown

Kbd

CtrlKOpen command palette

Progress

Rating

Theme confidence

Skeleton

Toast

Theme copied
CSS variables are ready for your app.

Toggle

Live preview

Copy CSS variables

Root and dark-mode overrides for Ocean.

:root {  --zui-brand: #0ea5e9;  --zui-brand-hover: #0284c7;  --zui-brand-fg: #082f49;  --zui-surface-muted: #e0f2fe;  --zui-surface-soft: color-mix(in oklch, var(--zui-brand) 10%, transparent);  --zui-surface-hover: color-mix(in oklch, var(--zui-brand) 16%, transparent);  --zui-border: color-mix(in oklch, var(--zui-brand) 32%, transparent);  --zui-focus-ring: #0ea5e9;  --zui-color-blue: var(--zui-brand);  --zui-button-default-bg: var(--zui-brand);  --zui-button-default-bg-hover: var(--zui-brand-hover);  --zui-button-default-fg: var(--zui-brand-fg);  --zui-badge-default-bg: var(--zui-surface-soft);  --zui-badge-default-fg: #075985;  --zui-alert-default-border: var(--zui-border);  --zui-alert-default-bg: var(--zui-surface-soft);  --zui-alert-default-fg: #075985;  --zui-alert-description-fg: #0369a1;  --zui-input-default-border: var(--zui-border);} .dark {  --zui-brand-dark: #7dd3fc;  --zui-brand-hover-dark: #38bdf8;  --zui-brand-fg-dark: #082f49;  --zui-surface-muted-dark: #0c4a6e;  --zui-surface-soft-dark: color-mix(in oklch, var(--zui-brand-dark) 16%, transparent);  --zui-surface-hover-dark: color-mix(in oklch, var(--zui-brand-dark) 22%, transparent);  --zui-border-dark: color-mix(in oklch, var(--zui-brand-dark) 34%, transparent);  --zui-focus-ring-dark: #7dd3fc;  --zui-color-blue-dark: var(--zui-brand-dark);  --zui-button-default-bg-dark: var(--zui-brand-dark);  --zui-button-default-bg-hover-dark: var(--zui-brand-hover-dark);  --zui-button-default-fg-dark: var(--zui-brand-fg-dark);  --zui-badge-default-bg-dark: var(--zui-surface-soft-dark);  --zui-badge-default-fg-dark: #bae6fd;  --zui-alert-default-border-dark: var(--zui-border-dark);  --zui-alert-default-bg-dark: var(--zui-surface-soft-dark);  --zui-alert-default-fg-dark: #e0f2fe;  --zui-alert-description-fg-dark: #bae6fd;  --zui-input-default-border-dark: var(--zui-border-dark);}

Theme palette

Override globals first

Global tokens sit below component variables. A component token such as --zui-button-default-bg still wins when you set it, but if it is not set the component falls through to shared globals like --zui-brand, --zui-border, --zui-surface-soft, and --zui-color-blue.

Brand

--zui-brand

#2563eb

Hover

--zui-brand-hover

#1d4ed8

Success

--zui-status-success

#16a34a

Warning

--zui-status-warning

#d97706

Error

--zui-status-error

#e11d48

Info

--zui-status-info

#0284c7

:root {
  --zui-brand: #2563eb;
  --zui-brand-hover: #1d4ed8;
  --zui-brand-fg: #ffffff;

  --zui-fg: #0f172a;
  --zui-fg-muted: #475569;
  --zui-surface-muted: #e2e8f0;
  --zui-surface-soft: color-mix(in oklch, var(--zui-brand) 8%, transparent);
  --zui-surface-hover: color-mix(in oklch, var(--zui-brand) 14%, transparent);
  --zui-border: color-mix(in oklch, var(--zui-brand) 24%, transparent);
  --zui-focus-ring: color-mix(in oklch, var(--zui-brand) 72%, #475569);

  --zui-status-success: #16a34a;
  --zui-status-warning: #d97706;
  --zui-status-error: #e11d48;
  --zui-status-info: #0284c7;

  --zui-color-blue: var(--zui-brand);
  --zui-color-indigo: #4f46e5;
  --zui-color-purple: #7c3aed;
  --zui-color-pink: #db2777;
}

.dark {
  --zui-brand-dark: #60a5fa;
  --zui-brand-hover-dark: #93c5fd;
  --zui-brand-fg-dark: #020617;

  --zui-fg-dark: #f8fafc;
  --zui-fg-muted-dark: #cbd5e1;
  --zui-surface-muted-dark: #1e293b;
  --zui-surface-soft-dark: color-mix(in oklch, var(--zui-brand-dark) 12%, transparent);
  --zui-surface-hover-dark: color-mix(in oklch, var(--zui-brand-dark) 18%, transparent);
  --zui-border-dark: color-mix(in oklch, var(--zui-brand-dark) 28%, transparent);
  --zui-focus-ring-dark: color-mix(in oklch, var(--zui-brand-dark) 72%, #cbd5e1);

  --zui-status-success-dark: #22c55e;
  --zui-status-warning-dark: #f59e0b;
  --zui-status-error-dark: #fb7185;
  --zui-status-info-dark: #38bdf8;

  --zui-color-blue-dark: var(--zui-brand-dark);
  --zui-color-indigo-dark: #818cf8;
  --zui-color-purple-dark: #c084fc;
  --zui-color-pink-dark: #f472b6;
}

Override snippet

Global theme variables

Start with these root-level variables, then add component-specific overrides from the CSS variable section on each component page.

:root {
  --zui-radius: 0.75rem;
  --zui-ring-offset: oklch(98.4% 0.003 247.858);
  --zui-focus-ring: oklch(44.6% 0.043 257.281);
  --zui-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  --zui-surface-muted: #e2e8f0;
  --zui-surface-soft: color-mix(in oklch, var(--zui-brand) 8%, transparent);
  --zui-surface-hover: color-mix(in oklch, var(--zui-brand) 14%, transparent);
  --zui-border: color-mix(in oklch, var(--zui-brand) 24%, transparent);
  --zui-fg: #0f172a;
  --zui-fg-muted: #475569;
  --zui-brand: #2563eb;
  --zui-brand-hover: color-mix(in oklch, var(--zui-brand) 88%, #000000);
  --zui-brand-fg: #ffffff;
  --zui-status-success: #16a34a;
  --zui-status-warning: #d97706;
  --zui-status-error: #e11d48;
  --zui-status-info: #0284c7;
  --zui-color-blue: var(--zui-brand);
  --zui-color-cyan: var(--zui-brand);
  --zui-color-green: var(--zui-brand);
  --zui-color-lime: var(--zui-brand);
  --zui-color-mint: var(--zui-brand);
  --zui-color-ocean: var(--zui-brand);
  --zui-color-sapphire: var(--zui-brand);
  --zui-color-lavender: var(--zui-brand);
  --zui-color-ruby: var(--zui-brand);
  --zui-color-red: var(--zui-brand);
  --zui-color-slate: var(--zui-brand);
  --zui-color-zinc: var(--zui-brand);
  --zui-color-stone: var(--zui-brand);
  --zui-color-royal: var(--zui-brand);
  --zui-color-electric: var(--zui-brand);
  --zui-color-forest: var(--zui-brand);
  --zui-color-sunset: var(--zui-brand);
  --zui-color-magenta: var(--zui-brand);
  --zui-color-crimson: var(--zui-brand);
  --zui-color-aqua: var(--zui-brand);
  --zui-color-plum: var(--zui-brand);
  --zui-color-emerald: var(--zui-brand);
  --zui-color-indigo: var(--zui-brand);
  --zui-color-purple: var(--zui-brand);
  --zui-color-pink: var(--zui-brand);
  --zui-color-rose: var(--zui-brand);
  --zui-color-sky: var(--zui-brand);
  --zui-color-teal: var(--zui-brand);
  --zui-color-yellow: var(--zui-brand);
  --zui-color-orange: var(--zui-brand);
  --zui-color-gray: var(--zui-brand);
  --zui-color-amber: var(--zui-brand);
  --zui-color-violet: var(--zui-brand);
  --zui-radius-xl: 0.75rem;
}

/* Dark theme tokens use the same contract with -dark appended. */
.dark {
  --zui-ring-offset-dark: oklch(12.9% 0.042 264.695);
  --zui-focus-ring-dark: oklch(86.9% 0.022 252.894);
  --zui-shadow-dark: 0 18px 48px rgba(15, 23, 42, 0.45);
  --zui-surface-muted-dark: #1e293b;
  --zui-surface-soft-dark: color-mix(in oklch, var(--zui-brand-dark) 12%, transparent);
  --zui-surface-hover-dark: color-mix(in oklch, var(--zui-brand-dark) 18%, transparent);
  --zui-border-dark: color-mix(in oklch, var(--zui-brand-dark) 28%, transparent);
  --zui-fg-dark: #f8fafc;
  --zui-fg-muted-dark: #cbd5e1;
  --zui-brand-dark: #60a5fa;
  --zui-brand-hover-dark: color-mix(in oklch, var(--zui-brand-dark) 88%, #ffffff);
  --zui-brand-fg-dark: #020617;
  --zui-status-success-dark: #22c55e;
  --zui-status-warning-dark: #f59e0b;
  --zui-status-error-dark: #fb7185;
  --zui-status-info-dark: #38bdf8;
  --zui-color-blue-dark: var(--zui-brand-dark);
  --zui-color-cyan-dark: var(--zui-brand-dark);
  --zui-color-green-dark: var(--zui-brand-dark);
  --zui-color-lime-dark: var(--zui-brand-dark);
  --zui-color-mint-dark: var(--zui-brand-dark);
  --zui-color-ocean-dark: var(--zui-brand-dark);
  --zui-color-sapphire-dark: var(--zui-brand-dark);
  --zui-color-lavender-dark: var(--zui-brand-dark);
  --zui-color-ruby-dark: var(--zui-brand-dark);
  --zui-color-red-dark: var(--zui-brand-dark);
  --zui-color-slate-dark: var(--zui-brand-dark);
  --zui-color-zinc-dark: var(--zui-brand-dark);
  --zui-color-stone-dark: var(--zui-brand-dark);
  --zui-color-royal-dark: var(--zui-brand-dark);
  --zui-color-electric-dark: var(--zui-brand-dark);
  --zui-color-forest-dark: var(--zui-brand-dark);
  --zui-color-sunset-dark: var(--zui-brand-dark);
  --zui-color-magenta-dark: var(--zui-brand-dark);
  --zui-color-crimson-dark: var(--zui-brand-dark);
  --zui-color-aqua-dark: var(--zui-brand-dark);
  --zui-color-plum-dark: var(--zui-brand-dark);
  --zui-color-emerald-dark: var(--zui-brand-dark);
  --zui-color-indigo-dark: var(--zui-brand-dark);
  --zui-color-purple-dark: var(--zui-brand-dark);
  --zui-color-pink-dark: var(--zui-brand-dark);
  --zui-color-rose-dark: var(--zui-brand-dark);
  --zui-color-sky-dark: var(--zui-brand-dark);
  --zui-color-teal-dark: var(--zui-brand-dark);
  --zui-color-yellow-dark: var(--zui-brand-dark);
  --zui-color-orange-dark: var(--zui-brand-dark);
  --zui-color-gray-dark: var(--zui-brand-dark);
  --zui-color-amber-dark: var(--zui-brand-dark);
  --zui-color-violet-dark: var(--zui-brand-dark);
}

Reference table

Global tokens from source

This table is derived from the exported constants in src/design-system/tokens.ts. The fallback column is the value Zentauri UI uses when no consumer override is present.

zuiGlobalThemeTokens.foundation

Shared foundation tokens for radius, focus rings, ring offsets, and shadows.

VariableFallbackThemePair
--zui-radius
0.75rem
Sharednone
--zui-ring-offset
#f8fafc
Light--zui-ring-offset-dark
--zui-ring-offset-dark
#020617
Dark--zui-ring-offset
--zui-focus-ring
color-mix(in oklch, var(--zui-brand) 72%, #475569)
Light--zui-focus-ring-dark
--zui-focus-ring-dark
color-mix(in oklch, var(--zui-brand-dark) 72%, #cbd5e1)
Dark--zui-focus-ring
--zui-shadow
0 8px 24px rgba(15, 23, 42, 0.12)
Light--zui-shadow-dark
--zui-shadow-dark
0 18px 48px rgba(15, 23, 42, 0.45)
Dark--zui-shadow

zuiGlobalThemeTokens.brand

Brand, foreground, border, and surface tokens used as fallbacks by component-level variables.

VariableFallbackThemePair
--zui-surface-muted
#e2e8f0
Light--zui-surface-muted-dark
--zui-surface-muted-dark
#1e293b
Dark--zui-surface-muted
--zui-surface-soft
color-mix(in oklch, var(--zui-brand) 8%, transparent)
Light--zui-surface-soft-dark
--zui-surface-soft-dark
color-mix(in oklch, var(--zui-brand-dark) 12%, transparent)
Dark--zui-surface-soft
--zui-surface-hover
color-mix(in oklch, var(--zui-brand) 14%, transparent)
Light--zui-surface-hover-dark
--zui-surface-hover-dark
color-mix(in oklch, var(--zui-brand-dark) 18%, transparent)
Dark--zui-surface-hover
--zui-border
color-mix(in oklch, var(--zui-brand) 24%, transparent)
Light--zui-border-dark
--zui-border-dark
color-mix(in oklch, var(--zui-brand-dark) 28%, transparent)
Dark--zui-border
--zui-fg
#0f172a
Light--zui-fg-dark
--zui-fg-dark
#f8fafc
Dark--zui-fg
--zui-fg-muted
#475569
Light--zui-fg-muted-dark
--zui-fg-muted-dark
#cbd5e1
Dark--zui-fg-muted
--zui-brand
#2563eb
Light--zui-brand-dark
--zui-brand-dark
#60a5fa
Dark--zui-brand
--zui-brand-hover
color-mix(in oklch, var(--zui-brand) 88%, #000000)
Light--zui-brand-hover-dark
--zui-brand-hover-dark
color-mix(in oklch, var(--zui-brand-dark) 88%, #ffffff)
Dark--zui-brand-hover
--zui-brand-fg
#ffffff
Light--zui-brand-fg-dark
--zui-brand-fg-dark
#020617
Dark--zui-brand-fg

zuiGlobalThemeTokens.status

Semantic status colors shared by success, warning, error, and info appearances.

VariableFallbackThemePair
--zui-status-success
#16a34a
Light--zui-status-success-dark
--zui-status-success-dark
#22c55e
Dark--zui-status-success
--zui-status-warning
#d97706
Light--zui-status-warning-dark
--zui-status-warning-dark
#f59e0b
Dark--zui-status-warning
--zui-status-error
#e11d48
Light--zui-status-error-dark
--zui-status-error-dark
#fb7185
Dark--zui-status-error
--zui-status-info
#0284c7
Light--zui-status-info-dark
--zui-status-info-dark
#38bdf8
Dark--zui-status-info

zuiGlobalThemeTokens.palette

Appearance palette tokens used by named color variants across components.

VariableFallbackThemePair
--zui-color-blue
var(--zui-brand)
Light--zui-color-blue-dark
--zui-color-blue-dark
var(--zui-brand-dark)
Dark--zui-color-blue
--zui-color-cyan
var(--zui-brand)
Light--zui-color-cyan-dark
--zui-color-cyan-dark
var(--zui-brand-dark)
Dark--zui-color-cyan
--zui-color-green
var(--zui-brand)
Light--zui-color-green-dark
--zui-color-green-dark
var(--zui-brand-dark)
Dark--zui-color-green
--zui-color-lime
var(--zui-brand)
Light--zui-color-lime-dark
--zui-color-lime-dark
var(--zui-brand-dark)
Dark--zui-color-lime
--zui-color-mint
var(--zui-brand)
Light--zui-color-mint-dark
--zui-color-mint-dark
var(--zui-brand-dark)
Dark--zui-color-mint
--zui-color-ocean
var(--zui-brand)
Light--zui-color-ocean-dark
--zui-color-ocean-dark
var(--zui-brand-dark)
Dark--zui-color-ocean
--zui-color-sapphire
var(--zui-brand)
Light--zui-color-sapphire-dark
--zui-color-sapphire-dark
var(--zui-brand-dark)
Dark--zui-color-sapphire
--zui-color-lavender
var(--zui-brand)
Light--zui-color-lavender-dark
--zui-color-lavender-dark
var(--zui-brand-dark)
Dark--zui-color-lavender
--zui-color-ruby
var(--zui-brand)
Light--zui-color-ruby-dark
--zui-color-ruby-dark
var(--zui-brand-dark)
Dark--zui-color-ruby
--zui-color-red
var(--zui-brand)
Light--zui-color-red-dark
--zui-color-red-dark
var(--zui-brand-dark)
Dark--zui-color-red
--zui-color-slate
var(--zui-brand)
Light--zui-color-slate-dark
--zui-color-slate-dark
var(--zui-brand-dark)
Dark--zui-color-slate
--zui-color-zinc
var(--zui-brand)
Light--zui-color-zinc-dark
--zui-color-zinc-dark
var(--zui-brand-dark)
Dark--zui-color-zinc
--zui-color-stone
var(--zui-brand)
Light--zui-color-stone-dark
--zui-color-stone-dark
var(--zui-brand-dark)
Dark--zui-color-stone
--zui-color-royal
var(--zui-brand)
Light--zui-color-royal-dark
--zui-color-royal-dark
var(--zui-brand-dark)
Dark--zui-color-royal
--zui-color-electric
var(--zui-brand)
Light--zui-color-electric-dark
--zui-color-electric-dark
var(--zui-brand-dark)
Dark--zui-color-electric
--zui-color-forest
var(--zui-brand)
Light--zui-color-forest-dark
--zui-color-forest-dark
var(--zui-brand-dark)
Dark--zui-color-forest
--zui-color-sunset
var(--zui-brand)
Light--zui-color-sunset-dark
--zui-color-sunset-dark
var(--zui-brand-dark)
Dark--zui-color-sunset
--zui-color-magenta
var(--zui-brand)
Light--zui-color-magenta-dark
--zui-color-magenta-dark
var(--zui-brand-dark)
Dark--zui-color-magenta
--zui-color-crimson
var(--zui-brand)
Light--zui-color-crimson-dark
--zui-color-crimson-dark
var(--zui-brand-dark)
Dark--zui-color-crimson
--zui-color-aqua
var(--zui-brand)
Light--zui-color-aqua-dark
--zui-color-aqua-dark
var(--zui-brand-dark)
Dark--zui-color-aqua
--zui-color-plum
var(--zui-brand)
Light--zui-color-plum-dark
--zui-color-plum-dark
var(--zui-brand-dark)
Dark--zui-color-plum
--zui-color-emerald
var(--zui-brand)
Light--zui-color-emerald-dark
--zui-color-emerald-dark
var(--zui-brand-dark)
Dark--zui-color-emerald
--zui-color-indigo
var(--zui-brand)
Light--zui-color-indigo-dark
--zui-color-indigo-dark
var(--zui-brand-dark)
Dark--zui-color-indigo
--zui-color-purple
var(--zui-brand)
Light--zui-color-purple-dark
--zui-color-purple-dark
var(--zui-brand-dark)
Dark--zui-color-purple
--zui-color-pink
var(--zui-brand)
Light--zui-color-pink-dark
--zui-color-pink-dark
var(--zui-brand-dark)
Dark--zui-color-pink
--zui-color-rose
var(--zui-brand)
Light--zui-color-rose-dark
--zui-color-rose-dark
var(--zui-brand-dark)
Dark--zui-color-rose
--zui-color-sky
var(--zui-brand)
Light--zui-color-sky-dark
--zui-color-sky-dark
var(--zui-brand-dark)
Dark--zui-color-sky
--zui-color-teal
var(--zui-brand)
Light--zui-color-teal-dark
--zui-color-teal-dark
var(--zui-brand-dark)
Dark--zui-color-teal
--zui-color-yellow
var(--zui-brand)
Light--zui-color-yellow-dark
--zui-color-yellow-dark
var(--zui-brand-dark)
Dark--zui-color-yellow
--zui-color-orange
var(--zui-brand)
Light--zui-color-orange-dark
--zui-color-orange-dark
var(--zui-brand-dark)
Dark--zui-color-orange
--zui-color-gray
var(--zui-brand)
Light--zui-color-gray-dark
--zui-color-gray-dark
var(--zui-brand-dark)
Dark--zui-color-gray
--zui-color-amber
var(--zui-brand)
Light--zui-color-amber-dark
--zui-color-amber-dark
var(--zui-brand-dark)
Dark--zui-color-amber
--zui-color-violet
var(--zui-brand)
Light--zui-color-violet-dark
--zui-color-violet-dark
var(--zui-brand-dark)
Dark--zui-color-violet

zuiFocusRing.default

Focus indicator color used by keyboard-visible focus states.

VariableFallbackThemePair
--zui-focus-ring
oklch(44.6% 0.043 257.281)
Light--zui-focus-ring-dark
--zui-focus-ring-dark
oklch(86.9% 0.022 252.894)
Dark--zui-focus-ring

zuiRingOffset.default

Surface color used behind focus rings when a ring offset is applied.

VariableFallbackThemePair
--zui-ring-offset
oklch(98.4% 0.003 247.858)
Light--zui-ring-offset-dark
--zui-ring-offset-dark
oklch(12.9% 0.042 264.695)
Dark--zui-ring-offset

zuiRadius.xl

Shared large radius primitive used by rounded component surfaces.

VariableFallbackThemePair
--zui-radius-xl
0.75rem
Sharednone

Component overrides

Jump to component CSS variables

Component-level overrides already live on each component preview page. Use these links when you need an exact variable such as --zui-button-blue-bg or --zui-alert-success-border.

Accordion338 component variablesAlert286 component variablesAnimated Number106 component variablesAvatar274 component variablesBadge209 component variablesBento grid119 component variablesBreadcrumb78 component variablesButton335 component variablesCalendar46 component variablesCard226 component variablesCheckbox192 component variablesCode Block32 component variablesCode Diff20 component variablesConsole Viewer52 component variablesCombobox446 component variablesCommand224 component variablesContextMenu386 component variablesCopy button375 component variablesDate picker30 component variablesDivider94 component variablesDrawer566 component variablesDropdown632 component variablesDynamic stepper422 component variablesEmpty state140 component variablesFile upload308 component variablesHash generator18 component variablesInputs1449 component variablesJSON Viewer40 component variablesTerminal Emulator36 component variablesAPI Endpoint Card46 component variablesAPI Response Viewer68 component variablesHTTP Request Viewer62 component variablesHTTP Status Badge72 component variablesRequest Timeline Viewer38 component variablesKbd303 component variablesLog Viewer68 component variablesMarquee190 component variablesModal566 component variablesNetwork Status52 component variablesOTP input214 component variablesPackage Install Command28 component variablesPagination302 component variablesPassword Strength Meter96 component variablesPopover256 component variablesProgress96 component variablesQR code8 component variablesQR scanner6 component variablesRadioGroup214 component variablesRating108 component variablesScrollArea150 component variablesSecret reveal118 component variablesSearch1449 component variablesSelect744 component variablesSkeleton238 component variablesSlider182 component variablesSpeech Recognition50 component variablesSpeech Synthesizer50 component variablesSpinner86 component variablesTable352 component variablesTabs366 component variablesTimeline285 component variablesToast280 component variablesToggle288 component variablesTooltip232 component variablesTreeView431 component variablesTyping indicator56 component variablesTypography104 component variables

Token contract

Zentauri UI exposes theme controls as CSS variables prefixed with --zui-. Component class strings include hardcoded fallbacks, so a missing override still renders with the library default.

The global token source is src/design-system/tokens.ts. This docs page reads those exported constants and shows the foundation tokens that component variables use as their fallback layer.

How the --zui-* contract resolves

The token system resolves in three layers: component-scoped variables first, shared global variables second, and literal fallbacks last. That lets teams theme a whole product through :root and .dark while still making precise exceptions for one component slot or appearance.

Preview appearances and copy variables

Use the token playground to switch between appearance presets, preview how buttons, badges, alerts, and inputs inherit the variables, and copy the CSS override block into an app theme.

Override globals first

Set brand, foreground, surface, border, status, and palette variables on :root and .dark to create a full product theme. Component variables such as --zui-button-default-bg remain available for exceptions on each component preview page, but most teams can theme broad surfaces with the smaller global token set.

Theming strategy

Start with global tokens for brand colors, status colors, surfaces, borders, focus rings, ring offsets, shadows, and shared radius. Then override component-level variables on each component page when you need appearance-specific colors, borders, shadows, or hover states.

Keep light and dark values paired so Tailwind scans both class variants and your theme remains predictable across mode changes.

Common use cases

  • Set one brand color palette across every interactive primitive.
  • Generate broad light and dark themes without hand-authoring component variables.
  • Use component-specific variables only when a single component needs a custom override.
  • Set brand focus-ring colors across every interactive primitive.
  • Align light and dark mode ring offsets with an app shell background.
  • Standardize large-radius surfaces without editing component source.
  • Document a product theme for downstream teams that vendor components with the CLI.

FAQ

Are these the only CSS variables Zentauri UI supports?

No. This page focuses on global tokens from src/design-system/tokens.ts. Component pages include their own CSS variable sections for component-specific appearances, slots, and states. Component tokens still win when both are set.

Do I need to override dark variables?

Only when your dark theme should differ from the shipped fallback. Dark tokens use the same name with -dark appended.

Where should overrides live?

Place broad theme overrides on :root and .dark, or scope them to a wrapper class when a product surface needs a local theme.

Should I override global tokens or component tokens?

Start with global tokens for brand, foreground, surface, border, status, and palette values. Add component-level overrides only for deliberate exceptions such as a custom button appearance or a special alert tone.