AI Sidebar

A file-tree sidebar for agent workspaces: folders and projects expand, files and bookmarks open, rows move by drag, keyboard or menu with rollback when your save fails, F2 renames in place, and long names truncate cleanly.

Preview

AI Sidebar preview width

Install

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

$ bunx --bun shadcn add @karaui/ai-sidebar
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

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

Mount the tree in the Animated Sidebar content area and show the selected item in the inset next to it.

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

Note: Message Scroller shows the chosen conversation in the inset. Prompt Input sits under the active content as the composer.

How it works

This sidebar manages workspace resources that keep changing, not just links to fixed pages. Folders and projects open to show what is inside; picking a file or bookmark makes it the active item, and any row can be moved or renamed without the rest of the workspace shifting.

Updated