Sidebar
Side panel on the start or end of the page, with groups, menus, badges and actions, that collapses off-screen or to icons and opens as a sheet on phones.
Parts
| Part | File | Does |
|---|---|---|
| Sidebar | Sidebar.vue | Holds the side navigation panel, which can collapse to icons or hide off-screen. |
| SidebarContent | SidebarContent.vue | Holds the scrollable groups and menus between the sidebar header and footer. |
| SidebarFooter | SidebarFooter.vue | Holds the content pinned at the bottom of the sidebar. |
| SidebarGroup | SidebarGroup.vue | Groups a label with the related menu items in the sidebar. |
| SidebarGroupAction | SidebarGroupAction.vue | Adds a small action button next to a sidebar group's label. |
| SidebarGroupContent | SidebarGroupContent.vue | Holds the menu belonging to a sidebar group. |
| SidebarGroupLabel | SidebarGroupLabel.vue | Labels a group of sidebar items with a heading. |
| SidebarHeader | SidebarHeader.vue | Holds the content pinned at the top of the sidebar, such as a search field. |
| SidebarInput | SidebarInput.vue | Lets the user search or filter from within the sidebar. |
| SidebarInset | SidebarInset.vue | Holds the main page content beside the sidebar. |
| SidebarMenu | SidebarMenu.vue | Lists the navigation items of a sidebar group. |
| SidebarMenuAction | SidebarMenuAction.vue | Adds a secondary action button to a sidebar menu item. |
| SidebarMenuBadge | SidebarMenuBadge.vue | Shows a count or status beside a sidebar menu item. |
| SidebarMenuButton | SidebarMenuButton.vue | Lets the user open a sidebar menu item, with a tooltip when collapsed. |
| SidebarMenuItem | SidebarMenuItem.vue | Groups one navigation entry with its button, action and badge. |
| SidebarMenuSkeleton | SidebarMenuSkeleton.vue | Shows a placeholder for a sidebar menu item while it loads. |
| SidebarMenuSub | SidebarMenuSub.vue | Lists the nested items under a sidebar menu item. |
| SidebarMenuSubButton | SidebarMenuSubButton.vue | Lets the user open a nested sidebar menu item. |
| SidebarMenuSubItem | SidebarMenuSubItem.vue | Groups one nested entry of a sidebar submenu. |
| SidebarProvider | SidebarProvider.vue | Groups all parts of the sidebar and shares its open state with them. |
| SidebarRail | SidebarRail.vue | Lets the user toggle the sidebar by clicking along its edge. |
| SidebarSeparator | SidebarSeparator.vue | Separates sections within the sidebar. |
| SidebarTrigger | SidebarTrigger.vue | Lets the user expand and collapse the sidebar. |
Anatomy
<SidebarProvider>
<Sidebar>
<SidebarHeader />
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel />
<SidebarGroupContent>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton />
<SidebarMenuAction />
<SidebarMenuSub>
<SidebarMenuSubItem>
<SidebarMenuSubButton />
</SidebarMenuSubItem>
</SidebarMenuSub>
<SidebarMenuSkeleton />
<SidebarMenuBadge />
</SidebarMenuItem>
</SidebarMenu>
<SidebarInput />
</SidebarGroupContent>
<SidebarGroupAction />
</SidebarGroup>
<SidebarSeparator />
</SidebarContent>
<SidebarFooter />
<SidebarRail />
</Sidebar>
<SidebarInset>
<SidebarTrigger />
</SidebarInset>
</SidebarProvider>Styling
All of Sidebar’s styles live in sidebar.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- @lucide/vue
- @vueuse/core
- class-variance-authority
- reka-ui
Built from
API reference
Holds the side navigation panel, which can collapse to icons or hide off-screen. Renders a <div>.
Props 5
| Prop | Type | Default | |
|---|---|---|---|
| side | SidebarSide | 'start' | |
| |||
| variant | SidebarVariant | — | |
| |||
| collapsible | SidebarCollapsible | 'offcanvas' | |
| |||
| label | string | 'Sidebar' | |
| |||
| description | string | 'Displays the mobile sidebar.' | |
| |||