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 system | Application adapter | React Aria component | |
|---|---|---|---|
| Primary responsibility | Define portable semantic intent and mode values. | Map source roles to component properties and set precedence. | Expose behavior, supported states, slots, and styling hooks. |
| Typical artifacts | Token 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 decision | Yes, 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 proof | No. 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. |
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;
}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>
);
}.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 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 renderAmbient Sage's actual tokens — the same values its exports use.
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 property | Mapping type | Reason | |
|---|---|---|---|
| Default background | No state attribute; background | Shared semantic role: --surface | The item uses the same neutral surface contract as its container. |
| Default text | No state attribute; color | Shared semantic role: --text | The role is reusable body foreground intent. |
| Hover background | [data-hovered]; background | Shared semantic role: --action-hover | Transient pointing feedback is shared across comparable action surfaces. |
| Pressed background | [data-pressed]; background | Shared semantic role: --action-pressed | Pressed needs a stronger temporary response than hover. |
| Selected background and text | [data-selected]; background and color | Component aliases resolving to --selection roles | Aliases preserve the option to change list selection later without changing every selected surface. |
| Focus indicator | [data-focus-visible]; outline | Shared semantic role: --focus-ring plus component-owned geometry | Color expresses shared focus intent; width and offset remain part of the component contract. |
| Disabled text and surface | [data-disabled]; color, background, and cursor | Shared disabled text role plus explicit component precedence | The selector prevents selected or hover styling from implying availability. |
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);
}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 changesUse 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
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
Check the adapter mapping
Verify that
--listbox-item-selectedresolves to the intended semantic role. A typo, stale generated file, or obsolete alias can break the chain before the component is involved. - 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
Inspect the active theme scope
Verify the ancestor carrying
.app-theme, itsdata-themevalue, and the resolved custom property on the ListBoxItem itself. - 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
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
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
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.