Bound controls
:select, :radio and :checkbox mean two things, and where they sit decides which. Inside a :form they are form fields, submitted by name. Outside one they bind to a declared :state the way :bind and :slider already do: move the control and the state changes, change the state and the control moves.
A settings panel
Density
Colour
Previews
What the panel drives
Every region below reads the same state the controls write.
Compact: rows sit tight together.
Spacious: rows get room to breathe.
Comfortable: the default spacing.
Comfortable: the default spacing.
Spacious: rows get room to breathe.
Comfortable: the default spacing.
Comfortable: the default spacing.
Following the operating system's colour scheme.
Forcing System regardless of the system setting.
Following the operating system's colour scheme.
Image previews are on.
Image previews are off, so the list loads text only.
Image previews are on.
Settings as one line each: Comfortable, System, previews true.
The rules
- The state has to exist first. A bound field with no matching
:stateis a compile error that names both readings, so a typo can never become a silently inert control. - A bound
:radiogroup carries the chosen option's text; the group keeps a sharednameso the browser makes it mutually exclusive. - A bound
:checkboxcarries a boolean, so it takes exactly one- Labelline, the label to show beside it. The multi-value checkbox group is the in-form behavior and is unchanged. - Inside a
:formnothing changed at all, even if a:stateof the same name happens to exist elsewhere on the page.