Skip to main content

Module sidebar

Module sidebar 

Source
Expand description

Sidebar Component

Animated sidebar styled like shadcn/ui Sidebar. Features smooth spring-based expand/collapse animations, multiple variants, group labels, collapsible groups, badges, and icon-only collapsed mode.

§Example

use armas_basic::components::{Sidebar, SidebarState, SidebarVariant};

// Controlled mode with external state
let mut state = SidebarState::new(true);

Sidebar::new()
    .state(&mut state)
    .variant(SidebarVariant::Floating)
    .show(ui, |sidebar| {
        sidebar.group_label("Platform");
        sidebar.item("Home", "Home").active(true);
        sidebar.item("Messages", "Messages").badge("5");
        sidebar.group("Settings", "Settings", |group| {
            group.item("Profile", "Profile");
            group.item("Security", "Security");
        });
    });

Structs§

Sidebar
Animated sidebar component styled to match shadcn/ui
SidebarBuilder
Builder for adding items to the sidebar
SidebarItemBuilder
Builder for configuring individual sidebar items
SidebarResponse
Response from sidebar interaction
SidebarState
Sidebar state that can be stored externally for controlled mode

Enums§

CollapsibleMode
Collapsible mode for the sidebar
SidebarVariant
Sidebar visual variant