State sources
Input state
Input state comes from components that capture user input:
When a user types in an Input or selects an option in a Select, the value is immediately stored in state.
Query state
Query state comes from database queries. Each query stores its results:Accessing state
State is accessed in code mode transforms using two functions:query(slug)
Returns data from a query by its slug:
input(slug)
Returns the value from an input component by its slug:
Example: Search and filter
This example shows state flowing from inputs to a filtered table: Components:- Input (slug:
simple-input-abc) — search term - Select (slug:
simple-select-def) — status filter - Table — displays filtered results
Persistence
State is automatically persisted to the browser’s IndexedDB with a 10-minute TTL. This means:- Refreshing the page preserves recent input values
- Stale data is automatically cleaned up
- No manual save/load required