pub struct ComboboxProps {
pub id: Option<Cow<'static, str>>,
pub name: Option<Cow<'static, str>>,
pub placeholder: Option<Cow<'static, str>>,
pub value: Option<Cow<'static, str>>,
pub options: Vec<ComboboxOption>,
pub disabled: bool,
pub class: Option<Cow<'static, str>>,
pub attrs: AttrMap,
pub children: Children,
}Expand description
Combobox — input with a filtered listbox of suggestions.
Reuses the upstream .select CSS class for the wrapper because Basecoat
styles input[role=combobox] through the .select layer.
The DOM contract emitted by the matching component function is:
<div class="select" id="{id}" data-combobox
data-basecoat-hydrate="combobox"
data-basecoat-version="0.2">
<input type="text" role="combobox"
aria-controls="{id}-listbox"
aria-expanded="false"
aria-autocomplete="list"
autocomplete="off"
data-combobox-input>
<div role="listbox" id="{id}-listbox" data-combobox-listbox hidden>
<button type="button" role="option"
id="{id}-option-{idx}"
data-value="{value}"
tabindex="-1">{label}</button>
...
</div>
</div>Fields§
§id: Option<Cow<'static, str>>Unique DOM id — required for the WASM controller to wire ARIA and the listbox association.
name: Option<Cow<'static, str>>Form field name for the hidden value.
placeholder: Option<Cow<'static, str>>Placeholder text rendered in the empty input.
value: Option<Cow<'static, str>>Initial input value (rendered as value="...").
options: Vec<ComboboxOption>Static set of options. Dynamic loading is planned for a future release.
disabled: boolDisable the input element.
class: Option<Cow<'static, str>>Extra CSS classes appended to the canonical .select class.
attrs: AttrMap§children: ChildrenSlot reserved for downstream extensions; the bundled component
function ignores children and renders options from options.
Implementations§
Source§impl ComboboxProps
impl ComboboxProps
pub const __BASECOAT_EXTEND_FIELD: Option<&'static str>
Sourcepub fn builder() -> ComboboxPropsBuilder
pub fn builder() -> ComboboxPropsBuilder
Create a builder for this prop struct.
Trait Implementations§
Source§impl Clone for ComboboxProps
impl Clone for ComboboxProps
Source§fn clone(&self) -> ComboboxProps
fn clone(&self) -> ComboboxProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more