Skip to main content
Sidebars are one of the most complex components to build. They are central to any application and often contain a lot of moving parts. Shad doesn’t like building sidebars, so he built 30+ of them with all kinds of configurations. The core components have been extracted into sidebar-*.svelte files, and you can use them in your own projects. We now have a solid foundation to build on top of. Composable. Themeable. Customizable. Browse the Blocks Library.

Installation

1

Install the sidebar components

2

Add colors to your CSS file

We’ll go over the colors later in the theming section.
src/routes/layout.css

Structure

A Sidebar component is composed of the following parts:
  • Sidebar.Provider - Handles collapsible state.
  • Sidebar.Root - The sidebar container.
  • Sidebar.Header and Sidebar.Footer - Sticky at the top and bottom of the sidebar.
  • Sidebar.Content - Scrollable content.
  • Sidebar.Group - Section within the Sidebar.Content.
  • Sidebar.Trigger - Trigger for the Sidebar.

Usage

src/routes/+layout.svelte
src/lib/components/app-sidebar.svelte
For complete documentation on all components, props, and advanced usage, visit the shadcn-svelte documentation.