Get started

React Aria design tokens: map semantic roles to component states

React Aria exposes behavior and styling states, but it doesn't decide what those states should look like. Your design system defines the reusable semantic roles. Your application then maps those roles to React Aria selectors, governs exceptions, and verifies the computed result. This guide traces that whole path through one ListBoxItem instead of treating token delivery as proof of adoption.

Updated November 26, 2026

Set the ownership boundary before naming tokens

Most React Aria token problems are ownership problems disguised as color problems. A selected item looks wrong, so someone changes the shared accent token. That may fix one list while repainting buttons, tabs, links, and other selected surfaces. Ask which layer made the wrong decision before asking which hex value looks better.

React Aria supplies accessible behavior and styling hooks. Its official styling guide documents default and custom class names, state attributes, render props, slots, component-provided CSS variables, and Tailwind routes. These mechanisms let you reach a component. They don't define your brand roles, theme policy, or exception rules.

Design systemApplication adapterReact Aria component
Primary responsibilityDefine portable semantic intent and mode values.Map source roles to component properties and set precedence.Expose behavior, supported states, slots, and styling hooks.
Typical artifactsToken source, generated exports, and usage guidance.Scoped CSS variables, selectors, component aliases, and exception records.Component API, rendered attributes, class names, and component CSS variables.
Owns a selected-state color decisionYes, when selection has shared meaning across components.Yes, when ListBoxItem needs an independent alias or approved exception.No. It exposes the selected state but doesn't choose the visual role.
Owns rendered proofNo. A source value proves availability only.Yes. The application records the named consumer and computed result.No. Exposing an attribute doesn't prove that application CSS adopted it.
Ownership matrix for a React Aria token adapter

Availability is not adoption

A semantic role can exist in a token file, resolve correctly in both modes, and still have no effect on the ListBoxItem. The adapter may omit it, the theme scope may be inactive, another selector may win, or a local declaration may replace it.

Use styling hooks for different jobs

The official styling mechanisms overlap, but they aren't interchangeable in practice. A class name identifies the component boundary. Data attributes express active states in CSS, while render props expose state to JavaScript when markup or content must change. Slots identify nested parts. Component-provided CSS variables carry values calculated by a component. Your own scoped variables deliver design-system roles into that structure.

  • Use a stable application class for the adapter boundary, such as ds-listbox-item.
  • Use documented state attributes for visual state selectors, such as selected, hovered, pressed, focus-visible, and disabled.
  • Use render props only when state changes structure or content, not merely to avoid writing a CSS selector.
  • Use slots when a component has separately styled parts that need explicit contracts.
  • Keep application theme variables distinct from any CSS variables supplied by React Aria itself.

This distinction matters during diagnosis. If the correct state attribute is absent, inspect the component behavior and fixture setup. If the attribute is present but the color is wrong, inspect the application mapping and cascade. Changing the upstream semantic token before locating that boundary can hide the real defect.

Build one complete ListBoxItem path

The fixture below keeps every handoff visible. Source roles live within an application theme scope. A second layer maps them to ListBoxItem aliases, and the component consumes only those aliases. The values stay confined to this fixture so you can copy the procedure without treating them as a universal React Aria palette.

.app-theme {
  /* Governed semantic roles, light mode */
  --surface: #f7f7f5;
  --text: #242521;
  --action-hover: #eceee8;
  --action-pressed: #dfe3da;
  --selection: #d5e7c8;
  --selection-text: #182012;
  --focus-ring: #3f6f2a;
  --disabled-text: #858980;

  /* Application-owned ListBoxItem adapter */
  --listbox-item-surface: var(--surface);
  --listbox-item-text: var(--text);
  --listbox-item-hover: var(--action-hover);
  --listbox-item-pressed: var(--action-pressed);
  --listbox-item-selected: var(--selection);
  --listbox-item-selected-text: var(--selection-text);
  --listbox-item-focus-ring: var(--focus-ring);
  --listbox-item-disabled-text: var(--disabled-text);
}

.app-theme[data-theme="dark"] {
  --surface: #171914;
  --text: #eef0e9;
  --action-hover: #24281f;
  --action-pressed: #30362a;
  --selection: #38542d;
  --selection-text: #f3f8ef;
  --focus-ring: #a6d88d;
  --disabled-text: #858c80;
}
Source roles and application aliases stay separate, giving each layer a clear owner.
import {ListBox, ListBoxItem} from 'react-aria-components';

export function ProjectList() {
  return (
    <div className="app-theme" data-theme="light">
      <ListBox
        aria-label="Projects"
        className="project-list"
        selectionMode="single"
      >
        <ListBoxItem id="atlas" className="ds-listbox-item">
          Atlas redesign
        </ListBoxItem>
        <ListBoxItem id="northstar" className="ds-listbox-item">
          Northstar research
        </ListBoxItem>
        <ListBoxItem
          id="archive"
          className="ds-listbox-item"
          isDisabled
        >
          Archived migration
        </ListBoxItem>
      </ListBox>
    </div>
  );
}
One named fixture provides selectable, unselected, and disabled items within an explicit theme scope.
.project-list {
  display: grid;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface);
}

.ds-listbox-item {
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--listbox-item-text);
  background: var(--listbox-item-surface);
  cursor: default;
  outline: 0;
}

.ds-listbox-item[data-hovered] {
  background: var(--listbox-item-hover);
}

.ds-listbox-item[data-pressed] {
  background: var(--listbox-item-pressed);
}

.ds-listbox-item[data-selected] {
  color: var(--listbox-item-selected-text);
  background: var(--listbox-item-selected);
}

.ds-listbox-item[data-focus-visible] {
  outline: 2px solid var(--listbox-item-focus-ring);
  outline-offset: 2px;
}

.ds-listbox-item[data-disabled] {
  color: var(--listbox-item-disabled-text);
  background: var(--listbox-item-surface);
  cursor: not-allowed;
}
Selector order encodes precedence: selected replaces hover and pressed backgrounds, focus remains additive, and disabled wins last.

Selector order is part of the component contract. Here, selected is a persistent state, so it wins over hover or pressed backgrounds. Focus-visible adds an outline without replacing the selected treatment. Disabled comes last and removes that treatment. React Aria doesn't set these defaults. They are application policy expressed through selectors.

Token specimen · real values

Ambient Sage

Live render

Ambient Sage's actual tokens — the same values its exports use.

Color tokensSemantic roles with HEX / HSL / CMYK

Color tokens

Ambient Sage
light · HEX · HSL · CMYK

Core

#F3F4EF

background

H 72 · C0, 0, 2, 4

#1A1C17

foreground

H 84 · C7, 0, 18, 89

#E5E6E0

card

H 70 · C0, 0, 3, 10

#ECEEE8

muted

H 80 · C1, 0, 3, 7

#D8D9D2

border

H 68.57 · C0, 0, 3, 15

Brand

#FEE951

primary

H 52.72 · C0, 8, 68, 0

#1A1C17

primary-fg

H 84 · C7, 0, 18, 89

#E5E6E0

secondary

H 70 · C0, 0, 3, 10

#F7E464

accent

H 52.24 · C0, 8, 60, 3

#FEE951

ring

H 52.72 · C0, 8, 68, 0

Semantic

#C0392B

destructive

H 5.64 · C0, 70, 78, 25

#FFFFFF

destructive-fg

H 0 · C0, 0, 0, 0

#2D7238

success

H 129.57 · C61, 0, 51, 55

#C97D12

warning

H 35.08 · C0, 38, 91, 21

#545651

muted-fg

H 84 · C2, 0, 6, 66

Charts

#FEE951

chart-1

H 52.72 · C0, 8, 68, 0

#4A8FD4

chart-2

H 210 · C65, 33, 0, 17

#6BBF8A

chart-3

H 142.14 · C44, 0, 28, 25

#E07498

chart-4

H 340 · C0, 48, 32, 12

#E8A24B

chart-5

H 33.25 · C0, 30, 68, 9

Radius & spacingCorner radius, elevation, and spacing steps

Tokens

Ambient Sage primitives
density: balanced

Radius scale

sm · 0.375rem
md · 0.75rem
lg · 1.25rem
xl · 1.75rem

Component radius

button
card
input

Elevation

level 1
level 2
level 3
level 4

Spacing · base 4px

1x
2x
3x
4x
6x
8x
A published semantic token system can supply upstream roles and mode values. The React Aria adapter and its state policy still belong to the consuming application.

Map each state by meaning, not convenience

Don't send every interactive state to a single accent role. Hover is transient feedback. Pressed marks an active interaction, while selected is persistent application state. Focus-visible communicates input location. Disabled means an action or option is unavailable. These states can share a value when the design system intends that relationship, but sharing should be a decision rather than a shortcut.

Trigger and propertyMapping typeReason
Default backgroundNo state attribute; backgroundShared semantic role: --surfaceThe item uses the same neutral surface contract as its container.
Default textNo state attribute; colorShared semantic role: --textThe role is reusable body foreground intent.
Hover background[data-hovered]; backgroundShared semantic role: --action-hoverTransient pointing feedback is shared across comparable action surfaces.
Pressed background[data-pressed]; backgroundShared semantic role: --action-pressedPressed needs a stronger temporary response than hover.
Selected background and text[data-selected]; background and colorComponent aliases resolving to --selection rolesAliases preserve the option to change list selection later without changing every selected surface.
Focus indicator[data-focus-visible]; outlineShared semantic role: --focus-ring plus component-owned geometryColor expresses shared focus intent; width and offset remain part of the component contract.
Disabled text and surface[data-disabled]; color, background, and cursorShared disabled text role plus explicit component precedenceThe selector prevents selected or hover styling from implying availability.
State-to-role decisions for the ListBoxItem fixture

When a component alias earns its place

Add a component alias when the component property may need to change independently without altering unrelated consumers. A component-shaped name alone isn't enough. If every selected surface should always change together, keep the shared semantic role.

Make theme scope and overrides visible

Light and dark values do nothing until the intended scope participates in the cascade. In the fixture, .app-theme establishes light values and .app-theme[data-theme="dark"] replaces them. The ListBox must sit inside that element. Move it outside the scope, apply the attribute to another subtree, or misspell the mode value, and the component will inherit another value or leave the variable unresolved.

Inheritance doesn't guarantee final use. A component declaration can replace an inherited variable, while a wrapper closer to the item can redefine an adapter alias. A more specific selector can also replace the component property itself. Inspect both the variable and the property that consumes it. Seeing the expected value under custom properties isn't enough if background-color comes from another rule.

.billing-panel {
  /* Deliberate local exception with a named owner and review trigger */
  --listbox-item-selected: var(--billing-selection);
}

/* A direct declaration would bypass the adapter variable. */
.billing-panel .ds-listbox-item[data-selected] {
  background: var(--billing-selection);
}
Variable overrides preserve the adapter path. Direct declarations bypass it and should be recorded separately.

Prefer the variable override when the exception still belongs to the ListBoxItem contract. Use a direct property declaration only when the exception genuinely needs a different implementation. Either route can be valid. Both need a bounded scope, an owner, and a condition that triggers review.

Start from a complete upstream token system

If your React application still lacks governed light and dark semantic roles, inspect a published kit before writing component aliases. The kit can supply the upstream design decisions; your application remains responsible for the React Aria mapping and verification.

Record expectations before inspecting the browser

A screenshot can show that something looks wrong, but it can't identify the failed handoff. Before inspection, record the expected source role, adapter alias, state, mode, property, and output. Then add the observed computed value. An open observation is more useful than an assumption recorded as a passing result.

record_id: react-aria-listboxitem-selected-dark
source_revision: fixture-2026-11-26
source_role: --selection
source_value_dark: "#38542d"
adapter_identity: --listbox-item-selected
component: ListBoxItem
component_class: ds-listbox-item
active_state: selected
state_hook: "[data-selected]"
mode: dark
expected_property: background-color
expected_output: "rgb(56, 84, 45)"
observed_computed_value: not_recorded
input_modality: keyboard
local_override: none
owner: application-design-system
exception_status: not_applicable
disposition: pending_observation
retest_triggers:
  - source token revision changes
  - adapter mapping changes
  - React Aria component version changes
  - selector precedence changes
  - theme scope changes
A filled expectation record leaves the observation open until someone runs the fixture.

Use separate records for combinations that can change the result. Selected in light mode isn't evidence for selected in dark mode, and keyboard focus isn't evidence for pointer hover. A passing isolated fixture doesn't prove that every product consumer has the same CSS, wrapper, theme scope, or exception.

Find the first divergent handoff

When the item renders incorrectly, inspect the chain in order. Stop at the first result that differs from the expectation. Any differences later in the chain may be consequences of that earlier break.

  1. 1

    Confirm the governed source

    Check the recorded source revision, role, mode value, and intended use. If selection was never defined upstream, keep the decision unresolved or assign an owner instead of guessing in the adapter.

  2. 2

    Check the adapter mapping

    Verify that --listbox-item-selected resolves to the intended semantic role. A typo, stale generated file, or obsolete alias can break the chain before the component is involved.

  3. 3

    Confirm that the expected CSS loaded

    Inspect the document's loaded styles and the matched rules for the named fixture. A correct file in the repository is irrelevant if the running application doesn't load it.

  4. 4

    Inspect the active theme scope

    Verify the ancestor carrying .app-theme, its data-theme value, and the resolved custom property on the ListBoxItem itself.

  5. 5

    Inspect the exposed React Aria state

    Confirm that the element has the expected state attribute during the recorded interaction. If it doesn't, check fixture state, selection configuration, and the current React Aria documentation.

  6. 6

    Find the winning component declaration

    In the browser's matched rules, locate the declaration that supplies the relevant property. Check selector order and specificity, especially when selected, hover, focus, and disabled overlap.

  7. 7

    Check local overrides

    Look for a closer custom-property definition, wrapper rule, inline style, utility class, or approved exception. Record whether the replacement is deliberate and current.

  8. 8

    Record the computed result

    Capture the computed property, mode, state, input modality, component revision, and disposition. A matching value supports this case only; it doesn't certify accessibility or every consumer.

Keep Identity Forge at the upstream boundary

Identity Forge can supply a complete design kit with semantic light and dark tokens, typography, spacing, layout guidance, DESIGN.md, and implementation exports. It doesn't currently claim a direct React Aria export or automatic React Aria mapping. Treat its artifacts as governed upstream input.

The consuming application still owns the adapter aliases, React Aria selectors, theme activation, overlapping-state precedence, component-specific exceptions, and observed results. It also owns accessibility evaluation in the real product. A token export can state intended values, but it can't prove that a keyboard interaction activated the expected state or that the rendered indicator works in every required environment.

Verify one item before expanding the adapter

Start with one ListBoxItem fixture. Inspect default, hover, pressed, selected, focus-visible, and disabled behavior in both modes. Record overlapping states separately wherever precedence matters. Extend the adapter to another component only after this first chain has a source revision, explicit mappings, computed observations, and owned exceptions.

Sources

  • Styling | React Aria: React Aria includes no default visual styles and exposes styling through class names, state attributes, render props, slots, CSS variables, and Tailwind integrations.
  • React Aria Tech Sample: This public implementation demonstrates the use of CSS custom properties and component styles in a React Aria design-system project.
  • Best React component libraries for design systems: Unstyled component foundations leave token structure and visual styling under the consuming team's control.
  • Semantic color tokens explained: Semantic color tokens name colors by purpose, support mode-specific values, and let components consume stable roles instead of raw colors.
  • Ambient Sage Design Kit: Ambient Sage is a published kit containing a documented visual direction, semantic colors, typography, and implementation material that can serve as upstream design-system input.