AI Sidebar

Preview

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/ai-sidebar

API Reference

items?
SidebarResource[]
Default—
defaultItems?
SidebarResource[]
Default[]
onItemsChange?
((items: SidebarResource[]) => void)
Default—
onMove?
((move: SidebarResourceMove) => void | Promise<void>)

Reject the promise to roll the optimistic move back.

Default—
onMoveError?
((error: unknown, move: SidebarResourceMove) => void)
Default—
onRename?
((item: SidebarResource, label: string) => void | Promise<void>)
Default—
activeId?
string | null
Default—
defaultActiveId?
string | null
Defaultnull
onActiveChange?
((id: string) => void)
Default—
defaultExpandedIds?
string[]
Default[]
renderIcon?
((item: SidebarResource) => ReactNode)
Default—
renderMenu?
((item: SidebarResource, controls: SidebarResourceMenuControls) => ReactNode)
Default—
ariaLabel?
string
Default—
className?
string
Default—
labels?
Partial<{ label: string; rename: string; renameItem: string; actions: string; moveUp: string; moveDown: string; moveInto: string; moveOut: string; moveToTop: string; movePending: string; movedBefore: string; ... 5 more ...; unnamedItem: string; }>

Override any built-in string.

Default—

Composition

Place the resource tree inside Animated Sidebar content and keep the selected resource surface in the sibling inset.

AnimatedSidebarProvider
├── AnimatedSidebar
│   ├── AnimatedSidebarContent
│   │   └── AISidebar
│   │       ├── Folder or project
│   │       └── File or bookmark
│   └── AnimatedSidebarRail
└── AnimatedSidebarInset

Note: Message Scroller can fill the inset with the selected conversation. Prompt Input can anchor the composer beneath active resource content.

How it works

An AI sidebar organizes changing workspace resources rather than only routing between fixed destinations. Folder and project rows disclose children, while files and bookmarks become the active resource and can move or rename without destabilizing the surrounding workspace.

Updated