Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

ColorTokenCard

  • Stable
  • WCAG 2.2 evidence
  • RTL

Documentation card for one colour token: a 96 px colour sample with an "Aa" text sample, then the name, token path, hex value and contrast note as text. The sample is decorative (aria-hidden); everything it shows is also written out, so colour is never the only identifier (WCAG 1.1.1, 1.3.1, 1.4.1). Codes stay left-to-right in RTL layouts. Presentational: renders in React Server Components. Consumer duties: accurate contrast notes (measure them; the card does not compute them) and name wording. For product UI, use Swatch instead.

import { ColorTokenCard } from "@nexera-ui/react";
Loading example…
4
examples
6
props
0
live controls
1
platform
6
WCAG criteria
0
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
Generated code
import { ColorTokenCard } from "@nexera-ui/react";

<ColorTokenCard />

Examples 3

The same examples as Storybook, rendered live. Open Code to copy one.

Palette

Theme-aware sample: color takes a CSS variable, so the sample follows Light and Dark; sampleColor sets the "Aa" ink. The cards wrap onto new rows in narrow containers.

Loading example…

Long content

Long names and token paths wrap instead of truncating.

Loading example…

Right to left

Right-to-left: the text aligns to the start (right); token and hex stay left-to-right.

Loading example…

Props 6

6 props shown

name*Nexera
ReactNode

Name of the colour. Wraps.

Default –
hex*Nexera
string

Hex value, shown as text so the colour is never identified by its look alone (WCAG 1.4.1). Also the sample fill unless color is set, and used to pick the ink of the "Aa" sample.

Default –
tokenNexera
ReactNode

Design token path. Shown when provided.

Default –
contrastNexera
ReactNode

Contrast note. Shown when provided.

Default –
colorNexera
string

CSS colour of the sample fill, for example var(--color-brand-primary) so the card follows the theme. Inline style, because it is data.

Default hex
sampleColorNexera
string

CSS colour of the "Aa" sample. By default the light or dark ink with the higher contrast on hex is used.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

3 direct · 3 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.3Contrast (Minimum)Level AA · supporting test
  • 1.4.10ReflowLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<ColorTokenCard className="shadow-sm" />

Used in blocks

No block uses ColorTokenCard yet.

Related components