pub struct SidebarProps {
pub id: Option<Cow<'static, str>>,
pub header: Option<Markup>,
pub footer: Option<Markup>,
pub default_open: bool,
pub breakpoint_px: f64,
pub class: Option<Cow<'static, str>>,
pub attrs: AttrMap,
pub children: Children,
}Expand description
Sidebar — maps to CSS class .sidebar.
Renders a responsive <aside> that behaves as an in-flow column above the
breakpoint_px viewport width and as an overlay drawer below it. The
matching WASM controller (basecoat-controllers) reads/writes the
expanded/collapsed state to localStorage under the key
basecoat:sidebar:{id} and toggles the data-state attribute.
The id is required: it is the key used both for the localStorage entry
and for matching the sibling toggle button’s aria-controls/
data-sidebar-toggle attribute.
Fields§
§id: Option<Cow<'static, str>>Unique DOM id — required for the controller and localStorage key.
header: Option<Markup>Optional <header class="sidebar-header"> content rendered at the top.
Optional <footer class="sidebar-footer"> content rendered at the bottom.
default_open: boolInitial expanded state. Defaults to true. The controller reconciles
this against localStorage on hydrate.
breakpoint_px: f64Viewport breakpoint in CSS pixels above which the sidebar is in-flow
rather than an overlay drawer. Defaults to 768.0 (Tailwind md).
class: Option<Cow<'static, str>>§attrs: AttrMap§children: ChildrenImplementations§
Source§impl SidebarProps
impl SidebarProps
pub const __BASECOAT_EXTEND_FIELD: Option<&'static str>
Sourcepub fn builder() -> SidebarPropsBuilder
pub fn builder() -> SidebarPropsBuilder
Create a builder for this prop struct.
Trait Implementations§
Source§impl Clone for SidebarProps
impl Clone for SidebarProps
Source§fn clone(&self) -> SidebarProps
fn clone(&self) -> SidebarProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more