Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Concepts
Overview
Customization

Semantic tokens

The roles the preset expects you to paint with.

Semantic tokens name a job, not a swatch. Use them in product UI. Reach for a palette slot when a component is explicitly accent, status, or catalog-colored.

Color roles

Surfaces

TokenUse
bgPage canvas
bg.surface / bg.panelCards, sheets
bg.elevatedRaised panels
bg.inset / bg.mutedRecessed wells
bg.overlayFloating overlay fill
bg.backdropDim behind a dialog
bg.invertedInverse canvas

bg.error, bg.warning, bg.success, bg.info, and bg.destructive are the muted slots of those palettes.

Foreground

TokenUse
fgBody text
fg.mutedSecondary text
fg.subtlePlaceholder, hints
fg.emphasizedStronger than body
fg.invertedText on bg.inverted

Status aliases: fg.error, fg.warning, fg.success, fg.info, fg.destructive.

Border and interaction

TokenUse
borderDefault hairline
border.muted / border.subtle / border.emphasizedRamp
border.invertedOn inverse surfaces
interaction.hoverHover wash
interaction.pressedPressed wash
interaction.selectedaccent.subtle

bg.subtle and bg.emphasized alias hover and pressed.

TokenUse
sidebar.bgSidebar canvas
sidebar.fgSidebar text
sidebar.borderSidebar rules
sidebar.accent.bg / sidebar.accent.fgActive nav

These follow the sidebar seed. A solid sidebar uses --sui-sidebar-solid.

Status, presence, shadow

TokenResolves to
status.*Palette solids. See Color system
presence.*Online / busy / dnd / away
shadowPigment for elevation. Default {colors.black} in both modes

Shadows (shadows.sm, shadows.overlay, …) reference {colors.shadow}. Set --color-shadow or the shadow token to retint elevation.

The token tables are on Colors.

Radii

Role radii wrap the primitive scale and the factor CSS variables:

radii.control = radii.sm × --scale-factor × --radius-factor × --radius-control-factor
RoleDefault primitiveUsed for
control / control.sm|md|lgxsmdButton, input, select
panel / panel.sm|md|lgsmlgCard, dialog, popover
indicator / indicator.sm|md|lgxsmdBadge, tag, avatar

l1, l2, l3 still exist as aliases of radii.xs|sm|md. Prefer the role tokens so Theme radius props have an effect.

See Radii.

Shadows and motion

Shadows are semantic. They use {colors.shadow} and a slight inset highlight in dark mode.

Motion exposes durations.motion.fast|medium|slow (plus .min / .max) and easings.standard. Those read --motion-* and --ease-standard.

Previous

Color system

Next

Theme