Headless UI & state
The exact CSS selectors coatx matches, and which headless libraries they cover.
coatx recipes take plain JS boolean props (checked, open, highlighted, invalid, pressed, selected, disabled, …). In addition, every stateful style also responds to native pseudo-classes and data-* / ARIA attributes, so headless libraries work with zero state wiring: spread the recipe and the CSS follows the library’s attributes.
Exact selectors
Every component part uses only the selectors meaningful for its state (a menu item matches highlight, a dialog matches open, and so on):
| Constant | Selector |
|---|---|
OPEN |
:is([open], [data-state=open], [data-open]) |
EXPANDED |
:is([aria-expanded=true], [data-state=open], [data-open]) |
CHECKED |
:is(:checked, [aria-checked=true], [data-state=checked], [data-checked]) |
INDETERMINATE |
:is(:indeterminate, [aria-checked=mixed], [data-state=indeterminate], [data-indeterminate]) |
HIGHLIGHTED |
:is([data-highlighted], [data-focus], [data-focused]) |
SELECTED |
:is([aria-selected=true], [data-selected], [data-state=active]) |
CURRENT |
:is([aria-current=page], [aria-current=true], [data-active]) |
PRESSED |
:is([aria-pressed=true], [data-state=on], [data-pressed]) |
INVALID |
:is(:user-invalid, [aria-invalid=true], [data-invalid]) |
DISABLED |
:is(:disabled, [aria-disabled=true], [data-disabled]) |
RTL |
:dir(rtl) |
Library coverage
| Library | How state flows | Example |
|---|---|---|
| Native HTML | pseudo-classes (:checked, :disabled, :user-invalid) and attributes (open, aria-*) |
<input type="checkbox">, <details>, <dialog> — see Plain HTML |
| Radix Primitives | data-state, data-highlighted, data-disabled |
Select.Item highlights via data-highlighted; no render prop needed |
| Ark UI / Zag.js | data-state, data-selected, data-focus, data-disabled |
Tabs.Trigger selects via data-selected |
| Base UI | data-checked, data-pressed, data-open, data-selected |
Checkbox.Root checks via data-checked |
| React Aria (silent) | data-selected, data-focused, data-disabled, data-pressed |
ListBox options select via data-selected |
| Headless UI | data-headlessui-state, aria-* |
aria-checked / aria-selected / aria-disabled match directly |
@ilha/ui-sdk |
JS state callbacks (state.checked, state.open, …) |
pass booleans from part class callbacks — see Ilha UI SDK & Astro |
| Render-prop libs | JS props | feed render-prop state (isSelected, …) into the recipe — see React |
Libraries that expose state only through render props (React Aria Components, Headless UI’s render-prop API) need the JS boolean props; libraries that write data-* / ARIA attributes to the DOM (Radix, Ark, Base UI, native HTML) need no extra code.
Toast animations
Toast enter/exit, stacking, and swipe animations read positioning variables set at runtime by @ui-sdk/core (--toast-index, --toast-offset, --toast-count, --toast-swipe-x, --toast-swipe-y, --toast-front-height, --toast-stack-height). Without a toast manager these variables are unset and toasts render statically in place — styled, but not animated.