Sidebar
A navigation component for displaying menu items and links in a vertical layout.
When To Use
Use the Sidebar component when you need to:
- Create a consistent navigation experience for your application
- Organize menu items hierarchically
- Provide a visible structure for your application
- Display navigation, categories, or actions in a vertical layout
- Implement collapsible or expandable navigation sections
- Create admin panels, dashboards, or complex applications
Sidebars help users navigate and understand the structure of your application, providing clear pathways to different sections or features.
Examples
Props
Sidebar
| Prop | Type | Default |
|---|---|---|
onOpenChange? | ((open: boolean) => void) | - |
open? | boolean | - |
defaultOpen? | boolean | - |
key? | Key | null | - |
ref? | Ref<HTMLDivElement> | - |