States
States are named boolean expressions over the live form data. Declare them once in formConfig.states, then reference the names from include / exclude rules, per-state property overrides, and selectors.
const formConfig = { states: { hasDiscount: '$form.hasDiscountCode === true', isAdult: '$form.driverAge >= 18', },};Expression syntax
Section titled “Expression syntax”Expressions are JavaScript-like. The engine exposes:
$form— the current form data tree.- Standard operators:
&&,||,!,===,!==,<,>,<=,>=,+,-,*,/,?:. - Optional chaining:
$form.user?.name.
Expressions can reference any path in the form data.
Where to use states
Section titled “Where to use states”- In
include/excluderules: gate widgets. - In per-state property overrides on shortcuts: change props when active.
- In
gui.selectors.state(...)chains: scope a selector to one state.
See also
Section titled “See also”- Features / States — gating, properties, composing.
- Conditionals —
include,exclude, inlinewhen.