pub struct DropdownProps {Show 13 fields
pub items: Vec<DropdownItem>,
pub trigger: DropdownTrigger,
pub placement: Option<DropdownPlacement>,
pub open: Option<bool>,
pub default_open: Option<bool>,
pub on_open_change: Option<EventHandler<bool>>,
pub on_click: Option<EventHandler<String>>,
pub disabled: bool,
pub class: Option<String>,
pub overlay_class: Option<String>,
pub overlay_style: Option<String>,
pub overlay_width: Option<f32>,
pub children: Element,
}Expand description
Props for the lightweight Dropdown component (MVP).
Fields§
§items: Vec<DropdownItem>Menu items to display in the dropdown.
trigger: DropdownTriggerTrigger mode. Defaults to click.
placement: Option<DropdownPlacement>Placement of the dropdown menu relative to the trigger.
open: Option<bool>Controlled open state. When set, the component becomes controlled.
default_open: Option<bool>Initial open state when used in uncontrolled mode.
on_open_change: Option<EventHandler<bool>>Called when the open state changes due to user interaction.
on_click: Option<EventHandler<String>>Called when a menu item is clicked.
disabled: boolDisable user interaction.
class: Option<String>Extra class applied to the trigger wrapper.
overlay_class: Option<String>Extra class applied to the dropdown menu.
overlay_style: Option<String>Inline styles applied to the dropdown menu.
overlay_width: Option<f32>Custom width for the dropdown menu in pixels (optional).
children: ElementTrigger element (usually a Button or link).
Implementations§
Source§impl DropdownProps
impl DropdownProps
Sourcepub fn builder() -> DropdownPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> DropdownPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building DropdownProps.
On the builder, call .items(...), .trigger(...)(optional), .placement(...)(optional), .open(...)(optional), .default_open(...)(optional), .on_open_change(...)(optional), .on_click(...)(optional), .disabled(...)(optional), .class(...)(optional), .overlay_class(...)(optional), .overlay_style(...)(optional), .overlay_width(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DropdownProps.
Trait Implementations§
Source§impl Clone for DropdownProps
impl Clone for DropdownProps
Source§fn clone(&self) -> DropdownProps
fn clone(&self) -> DropdownProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more