Skip to content

Precedence

When the engine resolves a widget’s final props, it merges several sources in this order (later sources win):

  1. Sensible defaults — auto-label, auto-placeholder, auto-stack, auto-submit.
  2. Type selectors — broad rules from gui.selectors.<type>(...).
  3. Tag selectorsgui.selectors.tag('...').<type>(...).
  4. State selectorsgui.selectors.state('...').<type>(...).
  5. Combined-scope selectorsgui.selectors.tag('...').state('...').<type>(...).
  6. <type>ByUid selectors — most specific selector match.
  7. Shortcut props — what you pass on the call site, e.g. gui.inputs.textInput('name', { label: 'Full name' }).
  8. Per-state property overridesstates: { foo: { label: '...' } } on the shortcut itself, applied when the state is active.
  • 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 byUid selector beats every broader selector but loses to shortcut props and per-state overrides.
  • 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.