- Accordion new
- ActionSheet new
- Alert new
- Alert Dialog new
- Angle Slider new
- Autocomplete new
- Avatar new
- Badge new
- Breadcrumb new
- Button new
- Button Group new
- Card new
- Carousel new
- Checkbox new
- Clipboard new
- Collapsible new
- Color Picker new
- Date Input new
- Date Picker new
- Dialog new
- DialogCaller new
- Drawer beta
- Editable new
- Empty new
- Field new
- Fieldset new
- File Upload new
- Filters new
- Floating Panel new
- Hover Card new
- Image new
- Image Cropper new
- Input new
- Input Group new
- Json Tree View new
- Kbd new
- Listbox new
- Marquee new
- Menu new
- Number Input new
- Pagination new
- Password Input new
- PhoneField new
- Pin Input new
- Popover new
- Progress Circular new
- Progress Linear new
- Qr Code new
- Radio Group new
- Rating Group new
- Scroll Area new
- ScrollSpy new
- Segment Group new
- Select new
- Separator new
- Sidebar new
- Signature Pad new
- Skeleton new
- Slider new
- Splitter new
- Steps new
- Switch new
- Table new
- Tabs new
- Tags Input new
- Textarea new
- Timeline new
- Timer new
- Toast new
- Toc new
- Toggle new
- Toggle Group new
- Tooltip new
- Tour new
- Tree View new
- Typography new
Installation
Install from the Vuzeno registry:
bunx --bun shadcn-vue@latest add https://vuzeno.com/r/sidebar.json
npx shadcn-vue@latest add https://vuzeno.com/r/sidebar.json
yarn dlx shadcn-vue@latest add https://vuzeno.com/r/sidebar.json
pnpm dlx shadcn-vue@latest add https://vuzeno.com/r/sidebar.json
Overview
The Sidebar is a composite layout component built on Ark UI primitives. It supports classic and inset variants, icon collapse with hover flyout submenus, responsive mobile drawer, multiple independent sidebars, and nested usage inside dialogs.
Composition
Sidebar.Provider
├── Sidebar.Root
│ ├── Sidebar.Header
│ ├── Sidebar.Content
│ │ └── Sidebar.Group
│ │ ├── Sidebar.GroupLabel
│ │ └── Sidebar.GroupContent
│ │ └── Sidebar.Menu
│ │ ├── Sidebar.MenuItem
│ │ │ └── Sidebar.MenuButton
│ │ └── Sidebar.MenuSub
│ │ ├── Sidebar.MenuSubTrigger
│ │ └── Sidebar.MenuSubContent
│ ├── Sidebar.Footer
│ └── Sidebar.Rail
└── Sidebar.Inset
└── Sidebar.Trigger
Theming
Sidebar colors use the design system CSS variables:
--sidebar,--sidebar-foreground--sidebar-primary,--sidebar-primary-foreground--sidebar-accent,--sidebar-accent-foreground--sidebar-border,--sidebar-ring
Layout variables are set per sidebar instance:
--sidebar-width(default16rem)--sidebar-width-icon(default3rem)--sidebar-width-mobile(default18remon mobile drawer)
Use Tailwind utilities such as bg-sidebar, text-sidebar-foreground, and border-sidebar-border.
By default, Sidebar.Provider is container-relative (h-full min-h-0) and fits inside bounded layouts such as demo cards or dialogs. Pass full-height for page-level layouts that should fill the viewport (min-h-svh).
useSidebar
useSidebar(id?) returns a ComputedRef<SidebarInstanceContext | undefined>. Access the resolved sidebar with .value, or pass an id when multiple sidebars are registered.
| Property | Type | Description |
|---|---|---|
state | "expanded" | "collapsed" | Derived open state for styling |
open | Ref<boolean> | Desktop expanded state |
setOpen | (boolean) => void | Set desktop open state |
openMobile | Ref<boolean> | Mobile drawer open state |
setOpenMobile | (boolean) => void | Set mobile drawer state |
isMobile | Ref<boolean> | Whether viewport is mobile |
toggleSidebar | () => void | Toggle desktop or mobile state |
id | string | Sidebar instance id |
side | "left" | "right" | Sidebar side |
variant | "sidebar" | "floating" | "inset" | Visual variant |
collapsible | "offcanvas" | "icon" | "none" | Collapse behavior |
Pass an id to useSidebar("left") when multiple sidebars are registered.
const sidebar = useSidebar();
sidebar.value?.toggleSidebar();
Examples
Inset variant
Visual variant where the main content is wrapped in a padded, rounded container.
Icon collapse with hover flyout
When collapsed to icon mode, submenus with children open a hover flyout menu instead of hiding nested items.
Multiple sidebars
Register left and right sidebars with independent state using the id prop and Sidebar.Trigger target.
Nested in a dialog
Sidebar.Provider is container-relative by default and fits inside dialogs or other bounded layouts. Pass full-height for page-level layouts.
Controlled
Control sidebar open state with v-model:open on Sidebar.Root.