@rokkit/states provides reactive state primitives, navigation controllers, and application
stores. These are the building blocks used internally by all Rokkit components — and available for
building custom accessible UI.
ProxyItem — view mapping
A read-only view that resolves field mappings for a single item. Used by all Rokkit components
to normalize data access via the fields prop:
ProxyTree is the hierarchical version, used for tree data. LazyProxyItem defers field resolution until accessed.
ListController — navigation state
Manages focus and selection state for a flat or grouped list. No DOM dependency — works in tests
without a browser. Used with the navigator action from @rokkit/actions:
TableController — tabular navigation
Manages row/column focus for data tables. Provides moveRow(delta), moveCol(delta), and cell selection. Used internally by the Table component.
vibe — reactive theming store
Tracks the current theme attributes on the <html> element. Read it to know
the active style, mode, and palette. ThemeSwitcherToggle from @rokkit/app writes to vibe when the user switches themes:
All exports
| Export | Type | Purpose |
|---|---|---|
ProxyItem | class | Read-only field-mapped view of one item |
LazyProxyItem | class | ProxyItem with deferred field resolution |
ProxyTree | class | Hierarchical ProxyItem for tree data |
Wrapper | class | Reactive model wrapper with change tracking |
LazyWrapper | class | Wrapper with lazy-loading support |
ListController | class | Flat/grouped list navigation state |
TableController | class | Row/column navigation for tables |
vibe | store | Reactive current-theme state (style/mode/palette) |
messages | store | App-level notification/toast message queue |
watchMedia | function | Reactive media query watcher |
defaultBreakpoints | object | Standard breakpoint definitions for watchMedia |
BASE_FIELDS | object | Default field mapping (label/value/icon/etc.) |
Related
- @rokkit/actions — The
navigatoraction pairs with controllers - @rokkit/app —
ThemeSwitcherTogglewrites tovibe - Controllers — Overview of the controller pattern