Precedence
When the engine resolves a widget’s final props, it merges several sources in this order (later sources win):
- Sensible defaults — auto-label, auto-placeholder, auto-stack, auto-submit.
- Type selectors — broad rules from
gui.selectors.<type>(...). - Tag selectors —
gui.selectors.tag('...').<type>(...). - State selectors —
gui.selectors.state('...').<type>(...). - Combined-scope selectors —
gui.selectors.tag('...').state('...').<type>(...). <type>ByUidselectors — most specific selector match.- Shortcut props — what you pass on the call site, e.g.
gui.inputs.textInput('name', { label: 'Full name' }). - Per-state property overrides —
states: { foo: { label: '...' } }on the shortcut itself, applied when the state is active.
Reading the order
Section titled “Reading the order”- The deeper into the chain a rule is, the higher its specificity (and thus its precedence).
- Per-state overrides on the shortcut itself sit above any selector — they’re the closest thing to “inline conditional props”.
- A
byUidselector beats every broader selector but loses to shortcut props and per-state overrides.
Practical implications
Section titled “Practical implications”- Don’t try to override per-widget styling from a tag selector if the shortcut explicitly sets the same prop. The shortcut wins.
- Use selectors for defaults; use shortcut props for overrides.
- Use per-state overrides on the shortcut itself for dynamic behavior tied to state changes.
See also
Section titled “See also”- Sensible defaults — what’s auto-applied at level 1.
- Form Definition / States — declaring states the engine evaluates.