Skip to main content

Root

Function Root 

Source
pub fn Root(_: RootProps) -> Element
Expand description

Context provider for the select compound component.

Wraps a Trigger (or Input) and a Content popup. Ships zero visual styles — all state is expressed through data-* attributes.

§Variants

  • Select-only: Compose Trigger + Value inside Root (no Input).
  • Combobox: Compose Input inside Root (enables search/filter).
  • Multiselect: Set multiple: true.

§Data attributes

  • data-select-state="open|closed"
  • data-select-disabled="true" (when disabled)

§Props

For details, see the props struct definition.

  • attributes : Vec<Attribute>
  • default_value : Option<String>

    Initial value (uncontrolled, single-select).

  • value : Option<Signal<String>>

    Controlled single-select value.

  • on_value_change : Option<EventHandler<String>>

    Fires when single-select value changes.

  • default_values : Option<Vec<String>>

    Initial values (uncontrolled, multi-select).

  • values : Option<Signal<Vec<String>>>

    Controlled multi-select values.

  • on_values_change : Option<EventHandler<Vec<String>>>

    Fires when multi-select values change.

  • multiple : bool

    Enable multi-select mode.

  • disabled : bool

    Disable the entire select.

  • default_open : bool

    Whether popup starts open.

  • open : Option<Signal<bool>>

    Controlled open state.

  • on_open_change : Option<EventHandler<bool>>

    Fires when open state changes.

  • autocomplete : AutoComplete

    Autocomplete mode (only relevant when Input child is present).

  • open_on_focus : bool

    Auto-open dropdown when input receives focus (combobox variant).

  • filter : Option<CustomFilter>

    Custom filter function. Overrides built-in nucleo fuzzy matching.

  • children : Element