PeakUI

Colors

Every color role in the theme, with the token and the utility that reach it

Colors are semantic: a component asks for a role, never for a value. Every role that carries content has a -foreground partner readable on it, and the two move together when a theme changes one.

Each role below is shown in both shipped themes at once, drawn from the tokens themselves. A variant is drawn inside the layer it appears on, because that is where it appears: a hover replaces the surface under it, a foreground is content on that surface, and a tint is stacked on whatever it tints. The name on a layer is written in the foreground it pairs with, so the label is the legibility test.

Accent

The primary action, used sparingly: overuse costs it its meaning. A -soft role is the same hue at low opacity, so what shows through it belongs to the layer underneath.

light
--accent
--accent-hover
--accent-foreground
--accent-soft over --surface
--accent-soft-hover
--accent-soft-foreground
dark
--accent
--accent-hover
--accent-foreground
--accent-soft over --surface
--accent-soft-hover
--accent-soft-foreground
bg-accenttext-accent-foregroundbg-accent-soft

Default

The neutral control: every button, chip and toggle that carries no status.

light
--default
--default-hover
--default-foreground
--default-soft over --surface
--default-soft-hover
--default-soft-foreground
dark
--default
--default-hover
--default-foreground
--default-soft over --surface
--default-soft-hover
--default-soft-foreground
bg-defaulttext-default-foreground

Success

light
--success
--success-hover
--success-foreground
--success-soft over --surface
--success-soft-hover
--success-soft-foreground
dark
--success
--success-hover
--success-foreground
--success-soft over --surface
--success-soft-hover
--success-soft-foreground
bg-successtext-success-foreground

Warning

light
--warning
--warning-hover
--warning-foreground
--warning-soft over --surface
--warning-soft-hover
--warning-soft-foreground
dark
--warning
--warning-hover
--warning-foreground
--warning-soft over --surface
--warning-soft-hover
--warning-soft-foreground
bg-warningtext-warning-foreground

Danger

light
--danger
--danger-hover
--danger-foreground
--danger-soft over --surface
--danger-soft-hover
--danger-soft-foreground
dark
--danger
--danger-hover
--danger-foreground
--danger-soft over --surface
--danger-soft-hover
--danger-soft-foreground
bg-dangertext-danger-foreground

Text

Text roles are drawn on the page itself. --muted is secondary text, not disabled text: a disabled control carries --disabled-opacity.

light--foreground--muted--link
dark--foreground--muted--link
text-foregroundtext-mutedtext-link

Backgrounds

The deeper levels exist for regions inside regions, which is how they are drawn here.

light
--background
--background-secondary
--background-tertiary
--background-inverse
dark
--background
--background-secondary
--background-tertiary
--background-inverse
bg-backgroundbg-background-secondary

Surfaces

A surface is a container that does not float: a card, a panel, a table header. Its levels nest the same way the backgrounds do.

light
--surface
--surface-hover
--surface-secondary
--surface-tertiary
dark
--surface
--surface-hover
--surface-secondary
--surface-tertiary
bg-surfacetext-surface-foreground

On Surface

Controls that sit on a surface rather than on the page, so they stay distinct from it.

light
--on-surface
--on-surface-hover
--on-surface-secondary
--on-surface-secondary-hover
--on-surface-tertiary
--on-surface-tertiary-hover
dark
--on-surface
--on-surface-hover
--on-surface-secondary
--on-surface-secondary-hover
--on-surface-tertiary
--on-surface-tertiary-hover
bg-on-surfacetext-on-surface-foreground

Overlays

A floating container — popover, menu, tooltip — and the scrim behind a modal one. --backdrop is translucent, so what you see through it is the page underneath.

light
--overlay
--overlay-foreground
--backdrop over --background
dark
--overlay
--overlay-foreground
--backdrop over --background
bg-overlaytext-overlay-foreground

Form Fields

A field carries its own roles, because it reads as an input whatever surface holds it. The border belongs to the field, so it is drawn inside it — and --field-border is transparent in both themes: the field is told apart by its background, and the outline appears on hover and focus.

light
--field-background
--field-placeholder
--field-border
--field-border-hover
--field-border-focus
--field-hover
--field-focus
dark
--field-background
--field-placeholder
--field-border
--field-border-hover
--field-border-focus
--field-hover
--field-focus
bg-fieldtext-field-foregroundtext-field-placeholder

Borders and Separators

A border outlines a thing; a separator divides two. Each has two quieter levels.

light
--border
--border-secondary
--border-tertiary
--separator
--separator-secondary
--separator-tertiary
dark
--border
--border-secondary
--border-tertiary
--separator
--separator-secondary
--separator-tertiary
border-borderborder-separator

Focus and Chrome

The thumb rides the track, so it is drawn on it.

light
--focus
--segment
--segment-foreground
--scrollbar-track
--scrollbar-thumb
dark
--focus
--segment
--segment-foreground
--scrollbar-track
--scrollbar-thumb
ring-focus

Primitives

Two values are absolute rather than semantic — --black and --white. They do not change with the theme, which is the only reason to reach for one.

Using a Role

Every role is a Tailwind utility and a custom property at once. Reach for the utility in markup and the property in CSS of your own.

<div className="bg-surface text-surface-foreground border-separator border">
  <span className="text-muted">Secondary</span>
</div>
.my-panel {
  background-color: var(--surface);
  color: var(--surface-foreground);
}

Take the pair, not one half of it: bg-surface with text-foreground survives the default theme and breaks in the next one.

Changing a Role

Override the property and every component that asks for the role follows — the mechanics, the levels at which an override lands and the dark-theme pair are in Theming. To try values against a whole page first, use the Theme Builder, which exports the CSS it shows.

On this page