AI Sidebar

A collapsible AI workspace sidebar for folders, projects, files, and bookmarks with keyboard navigation, optimistic moves, inline rename, and overflow-aware labels.

Preview

Workspace

Agent workspace

Draft

Selected resource

Review resource sidebar interaction details

Keep the resource tree predictable while files move between projects, labels overflow, and folders expand around the current selection.

Interaction notes

  • Folders only reveal their contents.
  • Files can be selected, moved, or renamed.
  • Rejected moves return to their previous location.

Install

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

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

API Reference

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

Reject the promise to roll the optimistic move back.

onMoveError?
((error: unknown, move: SidebarResourceMove) => void)
onRename?
((item: SidebarResource, label: string) => void | Promise<void>)
activeId?
string | null
defaultActiveId?
string | null
null
onActiveChange?
((id: string) => void)
defaultExpandedIds?
string[]
[]
renderIcon?
((item: SidebarResource) => ReactNode)
renderMenu?
((item: SidebarResource, controls: SidebarResourceMenuControls) => ReactNode)
ariaLabel?
string
Resources
className?
string

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