@chai-ui/tokens

Tokens

The single source of every color, size and timing in Chai UI. One JSON file builds into CSS custom properties, JavaScript and TypeScript, and a Figma token set, and this page reads the same source. No component uses a hard-coded color.

  1. Root palette. The raw colors. Nothing uses them directly.
  2. Semantic roles. What a color is for, like accent or control-border. Use these in your own UI, and override them to restyle everything at once.
  3. Component and Material tokens. Per-component hooks and the Material roles, both pointing at semantic roles. Override these to restyle one thing.

Root palette

Gray

gray-0
#000000
gray-10
#1a1a1a
gray-30
#4a4a4a
gray-40
#666666
gray-50
#8b8b8b
gray-60
#9e9e9e
gray-75
#c2c2c2
gray-80
#d9d9d9
gray-85
#e0e0e0
gray-90
#e9e9e9
gray-97
#f8f8f8
gray-100
#ffffff

Green

green-30
#005324
green-40
#006d32
green-50
#009747
green-60
#57b06c
green-80
#96f6c5
green-95
#e9f4e6

Amber

amber-30
#8c5615
amber-40
#a8681c
amber-50
#c98226
amber-80
#f0d3a4

Red

red-40
#a13c33
red-50
#c14e42
red-80
#f0c2bc

Region

Single shades for the edit card's regions; region 6 uses red-40.

cyan-40
#007c89
magenta-40
#a21caf
orange-40
#b45309
blue-40
#1565c0
violet-40
#6d28d9

Semantic roles

Brand and state

The logo green, the text that sits on it, and the warning and danger colors behind stop, retry and failed evaluations.

text-on-accent
#ffffff
accent
#009747
accent-hover
#006d32
accent-subtle
#e9f4e6
accent-soft
#96f6c5
accent-text
#006d32
warning
#c98226
warning-subtle
#f0d3a4
danger
#c14e42
danger-subtle
#f0c2bc

Controls

The pure grays every component is built from: fills, hovers, borders, text and icons.

control-surface
#f8f8f8
control-surface-hover
#e9e9e9
control-field
#e9e9e9
control-surface-raised
#ffffff
control-track
#e0e0e0
control-divider
#e0e0e0
control-border
#8b8b8b
control-border-soft
#9e9e9e
control-border-faint
#c2c2c2
control-text-strong
#1a1a1a
control-text
#4a4a4a
control-text-muted
#666666

Overlays and media

Buttons and backdrops that sit on top of images and video, and the label on the dark fade under paginated media.

overlay
rgba(0, 0, 0, 0.5)
on-overlay
#ffffff
overlay-light
rgba(255, 255, 255, 0.5)
scrim
rgba(0, 0, 0, 0.6)
media-backdrop
#000000
on-media-fade
#d9d9d9

Edit regions

One color per marked region in the edit card: its box, number badge and Composer chip. White text on each is at least 4.7:1.

region-1
#007c89
region-2
#a21caf
region-3
#b45309
region-4
#1565c0
region-5
#6d28d9
region-6
#a13c33

Material roles

The Material web components Chai renders (the switch, the submit button and the outlined text field) read --md-sys-color-* variables. Each one points at a Chai role, so Material follows Chai and never introduces a color of its own.

Material roleChai roleValue
--md-sys-color-primaryaccent#009747
--md-sys-color-on-primarycontrol-surface-raised#ffffff
--md-sys-color-primary-containeraccent-soft#96f6c5
--md-sys-color-on-primary-containeraccent-text#006d32
--md-sys-color-secondaryaccent#009747
--md-sys-color-secondary-containeraccent-soft#96f6c5
--md-sys-color-on-secondary-containeraccent-text#006d32
--md-sys-color-tertiary-containeraccent-soft#96f6c5
--md-sys-color-on-tertiary-containeraccent-text#006d32
--md-sys-color-errordanger#c14e42
--md-sys-color-on-error-containerdanger#c14e42
--md-sys-color-surfacecontrol-surface-raised#ffffff
--md-sys-color-surface-container-lowcontrol-surface#f8f8f8
--md-sys-color-surface-container-highcontrol-surface-hover#e9e9e9
--md-sys-color-surface-container-highestcontrol-track#e0e0e0
--md-sys-color-on-surfacecontrol-text-strong#1a1a1a
--md-sys-color-on-surface-variantcontrol-text#4a4a4a
--md-sys-color-outlinecontrol-border#8b8b8b
--md-sys-color-shadowmedia-backdrop#000000

Component tokens

Components with their own look expose per-component hooks, each defaulting to a control role. Set one on the component's root class to restyle just that component, for example .chai-composer { --chai-composer-bg: … }.

--chai-composer-bg--chai-composer-border--chai-composer-text--chai-composer-placeholder--chai-composer-hover--chai-media-analyzer-bg--chai-media-analyzer-border--chai-media-analyzer-text--chai-media-analyzer-hover

Space

space.00px
space.14px
space.28px
space.312px
space.416px
space.524px
space.632px
space.748px
space.864px

Radius

radius.sm6px
radius.md10px
radius.lg16px
radius.full999px

Typography

Families

type.family.baseThe quick brown fox
type.family.monoThe quick brown fox
type.family.materialThe quick brown fox

Sizes

type.size.xsThe quick brown fox
type.size.smThe quick brown fox
type.size.mdThe quick brown fox
type.size.lgThe quick brown fox
type.size.xlThe quick brown fox
type.size.2xlThe quick brown fox
type.size.title-largeThe quick brown fox
type.size.title-mediumThe quick brown fox
type.size.body-largeThe quick brown fox
type.size.body-mediumThe quick brown fox
type.size.label-largeThe quick brown fox
type.size.label-smallThe quick brown fox

Weights

type.weight.regularThe quick brown fox · 440
type.weight.mediumThe quick brown fox · 540
type.weight.semiboldThe quick brown fox · 620
type.weight.material-regularThe quick brown fox · 400
type.weight.material-mediumThe quick brown fox · 500

Line height

type.leading.tight1.15
type.leading.base1.45
type.leading.loose1.7
type.leading.title-large28px
type.leading.title-medium24px
type.leading.body-large24px
type.leading.body-medium20px
type.leading.label-large20px
type.leading.label-small16px

Motion

motion.duration.fast120ms
motion.duration.base200ms
motion.duration.slow360ms
motion.duration.steep900ms
motion.easing.standardcubic-bezier(0.2, 0, 0, 1)
motion.easing.growthcubic-bezier(0.34, 1.2, 0.64, 1)

Shadow and gradient

shadow.menu
gradient.ai
gradient.media-fade