Components
- Accordion
- Add to Cart
- Animated List
- Carousel
- Collapsible Sidebarnew
- Dynamic Island
- Expandable Cardnew
- Expanding Searchnew
- Filter Grid
- Kanban Board
- Layout Switcher
- Morphing Popover
- Number Flip
- Page Transition
- Product Gallery
- Segmented Control
- Sortable Table
- Stack Navigator
- Status Button
- Step Wizard
- Tabs
- Text Morphnew
- Theme Mode Switch
- Theme Morph Button
- Theme Toggle Button
- Theme Toggle Switch
- Theme Transition
- Toast Stacknew
Home
Installation
$ pnpm dlx shadcn@latest add @transition-kit/collapsible-sidebarUsage
import {
CollapsibleSidebar,
CollapsibleSidebarInset,
CollapsibleSidebarItem,
CollapsibleSidebarProvider,
CollapsibleSidebarTrigger,
} from "@/components/transitions/collapsible-sidebar";<CollapsibleSidebarProvider defaultValue="home">
<CollapsibleSidebar aria-label="Main">
<CollapsibleSidebarTrigger />
<CollapsibleSidebarItem value="home" icon={<HouseIcon />}>
Home
</CollapsibleSidebarItem>
<CollapsibleSidebarItem value="inbox" icon={<InboxIcon />}>
Inbox
</CollapsibleSidebarItem>
</CollapsibleSidebar>
<CollapsibleSidebarInset>{/* page content */}</CollapsibleSidebarInset>
</CollapsibleSidebarProvider>useCollapsibleSidebar() returns { collapsed, setCollapsed, value, select } inside the provider.
API Reference
CollapsibleSidebarProvider
| Prop | Type | Default | Description |
|---|---|---|---|
collapsed | boolean | - | Controlled collapsed state. |
defaultCollapsed | boolean | false | Initial collapsed state when uncontrolled. |
onCollapsedChange | (collapsed: boolean) => void | - | Called when the sidebar collapses or expands. |
value | string | - | Controlled active item. |
defaultValue | string | "" | Initial active item when uncontrolled. |
onValueChange | (value: string) => void | - | Called when another item is chosen. |
CollapsibleSidebarItem
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Identifies the item. |
icon | ReactNode | - | Shown in both states. |
Change the corner radius with :root { --tk-ui-collapsible-sidebar-radius: 1rem; }.