Sidebar

A composable, themeable, and customizable sidebar component.

Projects

Sections

A simple sidebar with navigation grouped by section

Collapsible Sections

A sidebar with collapsible sections

Submenus

A sidebar with submenus

Floating Submenus

A floating sidebar with submenus

Collapsible Submenus

A floating sidebar with collapsible submenus

Submenu Dropdown

A sidebar with submenus as dropdowns

Subscribe to our newsletter

Opt-in to receive updates and news about the sidebar.

Icons

A sidebar that collapses to icons

Projects

Secondary Navigation

An inset sidebar with secondary navigation

Projects

Nested

Collapsible nested sidebars

Inbox
WS
William Smith09:34 AM
Meeting Tomorrow
Hi team, just a reminder about our meeting tomorrow at 10 AM. Please come prepared with your project updates.
AS
Alice SmithYesterday
Re: Project Update
Thanks for the update. The progress looks great so far. Let's schedule a call to discuss the next steps.
BJ
Bob Johnson2 days ago
Weekend Plans
Hey everyone! I'm thinking of organizing a team outing this weekend. Would you be interested in a hiking trip or a beach day?
ED
Emily Davis2 days ago
Re: Question about Budget
I've reviewed the budget numbers you sent over. Can we set up a quick call to discuss some potential adjustments?
MW
Michael Wilson1 week ago
Important Announcement
Please join us for an all-hands meeting this Friday at 3 PM. We have some exciting news to share about the company's future.
SB
Sarah Brown1 week ago
Re: Feedback on Proposal
Thank you for sending over the proposal. I've reviewed it and have some thoughts. Could we schedule a meeting to discuss my feedback in detail?
DL
David Lee1 week ago
New Project Idea
I've been brainstorming and came up with an interesting project concept. Do you have time this week to discuss its potential impact and feasibility?
OW
Olivia Wilson1 week ago
Vacation Plans
Just a heads up that I'll be taking a two-week vacation next month. I'll make sure all my projects are up to date before I leave.
JM
James Martin1 week ago
Re: Conference Registration
I've completed the registration for the upcoming tech conference. Let me know if you need any additional information from my end.
SW
Sophia White1 week ago
Team Dinner
To celebrate our recent project success, I'd like to organize a team dinner. Are you available next Friday evening? Please let me know your preferences.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::Sidebar::*;

#[component]
pub fn SidebarAnatomy() -> impl IntoView {
    view! {
        <SidebarProvider>
            <Sidebar>
                <SidebarHeader />
                <SidebarContent>
                    <SidebarGroup>
                        <SidebarGroupLabel />
                        <SidebarGroupContent>
                            <SidebarMenu>
                                <SidebarMenuItem>
                                    <SidebarMenuButton />
                                </SidebarMenuItem>
                                <SidebarMenuItem>
                                    <Collapsible>
                                        <CollapsibleTrigger>
                                            <SidebarMenuButton />
                                        </CollapsibleTrigger>
                                        <CollapsibleContent>
                                            <SidebarMenuSub>
                                                <SidebarMenuSubItem>
                                                    <SidebarMenuSubButton />
                                                </SidebarMenuSubItem>
                                            </SidebarMenuSub>
                                        </CollapsibleContent>
                                    </Collapsible>
                                </SidebarMenuItem>
                            </SidebarMenu>
                        </SidebarGroupContent>
                    </SidebarGroup>
                </SidebarContent>
                <SidebarFooter />
                <SidebarRail />
            </Sidebar>
            <main>
                <SidebarTrigger />
            </main>
        </SidebarProvider>
    }
}

API Reference

Sidebar

The sidebar container.

Implements global attributes.

SidebarContent

A scrollable wrapper displayed in the middle of the sidebar.

Implements global attributes.

SidebarFooter

A sticky footer displayed at the bottom of the sidebar.

Implements global attributes.

SidebarGroup

Creates a section in the content area of the sidebar that groups similar items.

Implements global attributes.

SidebarGroupContent

Wraps the content of a sidebar group.

SidebarGroupLabel

The label displayed above the group.

Implements global attributes.

SidebarHeader

A sticky header displayed at the top of the sidebar.

Implements global attributes.

SidebarMenu

For building a menu within a SidebarGroup.

Implements global attributes.

SidebarMenuButton

Wraps content displayed in the click area of a SidebarMenuItem.

SidebarMenuItem

Contains an element within the SidebarMenu.

Implements global and li attributes.

SidebarMenuSub

Wraps a submenu within a SidebarMenu.

SidebarMenuSubItem

A menu item within the SidebarMenuSub menu.

Implements global and li attributes.

SidebarProvider

Takes in initial state and provides SidebarContext to its children.

Custom Attributes
NameTypeDefaultDescription
hiddenboolfalse

Reactive signal coupled to the sidebar's hidden state.

sideString"left"

Reactive signal coupled to which side of its container the sidebar renders on.

SidebarSeparator

Visually separates sidebar content.

Implements global attributes.

SidebarTrigger

Wrapper that toggles showing/hiding of the sidebar.

Implements global attributes.