pub struct DropdownProps {
pub id: Option<Cow<'static, str>>,
pub trigger: Option<Markup>,
pub items: Vec<DropdownItem>,
pub menu_label: Option<Cow<'static, str>>,
pub placement: Option<Cow<'static, str>>,
pub class: Option<Cow<'static, str>>,
pub attrs: AttrMap,
pub children: Children,
}Expand description
Dropdown — maps to CSS class .dropdown-menu.
The DOM contract is:
<details class="dropdown-menu" data-basecoat-hydrate="dropdown"
data-basecoat-version="0.2" data-dropdown id="{id}">
<summary aria-haspopup="menu" aria-expanded="false">{trigger}</summary>
<div role="menu">
<button type="button" role="menuitem" tabindex="-1">{label}</button>
...
</div>
</details>id is required so the WASM controller can attach.
Fields§
§id: Option<Cow<'static, str>>Unique DOM id — required for the WASM controller.
trigger: Option<Markup>Trigger content (rendered inside <summary>).
items: Vec<DropdownItem>Items rendered inside the menu container.
Optional aria-label for the menu container.
placement: Option<Cow<'static, str>>Floating placement string passed to @floating-ui/dom
(default "bottom-start").
class: Option<Cow<'static, str>>Extra CSS classes appended after dropdown-menu.
attrs: AttrMap§children: ChildrenImplementations§
Source§impl DropdownProps
impl DropdownProps
pub const __BASECOAT_EXTEND_FIELD: Option<&'static str>
Sourcepub fn builder() -> DropdownPropsBuilder
pub fn builder() -> DropdownPropsBuilder
Create a builder for this prop struct.
Trait Implementations§
Source§impl Clone for DropdownProps
impl Clone for DropdownProps
Source§fn clone(&self) -> DropdownProps
fn clone(&self) -> DropdownProps
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DropdownProps
impl Debug for DropdownProps
Source§impl Default for DropdownProps
impl Default for DropdownProps
Source§fn default() -> DropdownProps
fn default() -> DropdownProps
Returns the “default value” for a type. Read more
Source§impl From<DropdownPropsBuilder> for DropdownProps
impl From<DropdownPropsBuilder> for DropdownProps
Source§fn from(b: DropdownPropsBuilder) -> Self
fn from(b: DropdownPropsBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DropdownProps
impl RefUnwindSafe for DropdownProps
impl Send for DropdownProps
impl Sync for DropdownProps
impl Unpin for DropdownProps
impl UnsafeUnpin for DropdownProps
impl UnwindSafe for DropdownProps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more