pub struct SelectProps {
pub id: Option<Cow<'static, str>>,
pub name: Option<Cow<'static, str>>,
pub label: Option<Cow<'static, str>>,
pub value: Option<Cow<'static, str>>,
pub placeholder: Option<Cow<'static, str>>,
pub disabled: bool,
pub options: Vec<SelectOption>,
pub class: Option<Cow<'static, str>>,
pub attrs: AttrMap,
pub children: Children,
}Expand description
Select — maps to CSS class .select (custom-styled native form select).
Renders a hidden native <select> (the source of truth for form
submission) alongside a visible trigger button and a floating listbox.
The controller wires the listbox open/close behaviour, keyboard
navigation, dismiss handling, and synchronizes the hidden element on
option click.
Fields§
§id: Option<Cow<'static, str>>Unique DOM id for the trigger button — required for the controller
to find the element. The hidden <select> and listbox derive their
ids from this value.
name: Option<Cow<'static, str>>Form name for the hidden native <select> element.
label: Option<Cow<'static, str>>Accessible label associated via aria-label on the trigger.
value: Option<Cow<'static, str>>Initial selected value. Must match one of the option values.
placeholder: Option<Cow<'static, str>>Placeholder text shown when no option is selected.
disabled: boolWhether the entire select is disabled.
options: Vec<SelectOption>The list of selectable options.
class: Option<Cow<'static, str>>Extra CSS classes appended to the .select wrapper.
attrs: AttrMapExtra HTML attributes for the outer wrapper.
children: ChildrenOptional inline children (rendered inside the listbox before the
option buttons). Most callers should leave this empty and use
options instead.
Implementations§
Source§impl SelectProps
impl SelectProps
pub const __BASECOAT_EXTEND_FIELD: Option<&'static str>
Sourcepub fn builder() -> SelectPropsBuilder
pub fn builder() -> SelectPropsBuilder
Create a builder for this prop struct.
Trait Implementations§
Source§impl Clone for SelectProps
impl Clone for SelectProps
Source§fn clone(&self) -> SelectProps
fn clone(&self) -> SelectProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more