# Sidebar

> A composable, themeable, and customizable sidebar.

Source: https://ui.cortexcn.dev/docs/components/sidebar

## Installation

```bash
npx shadcn@latest add @cortexcn/sidebar
```

The sidebar reads its colors from the `--sidebar` tokens that `shadcn init` adds to your theme.

## Usage

```tsx
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "@/components/sidebar";
```

Wrap your layout in `SidebarProvider`, put a `Sidebar` next to a `SidebarInset`, and add a `SidebarTrigger` to toggle it. Press Ctrl+B (Cmd+B on a Mac) to toggle it from the keyboard.

## Examples

### Default

### Floating

### Collapsible to icons

### Inset

Adapted from the [shadcn/ui Sidebar](https://ui.shadcn.com/docs/components/radix/sidebar) (MIT).