AI Sidebar

A feature-packed AI navigation sidebar — brand header, chat history groups, search, new chat, hover actions, collapsed rail, and user footer. Fully prop-driven.

Expanded

Brand header, new chat, quick nav, searchable history with pin/rename/delete, and a profile footer.

Loading…

Installation

CLI
npx @sonojs/ui@latest add ai-sidebar
Also needsnpx @sonojs/ui@latest add avatar button input && npm i lucide-react motion

Usage

ai-sidebar.tsx
import { AiSidebar } from "@/components/sonojs/ai-sidebar"

export function Example() {
  return (
    <AiSidebar
      brandName="Sono"
      user={{ name: "Alex Rivera", plan: "Free" }}
      onNewChat={() => {}}
      onSelectChat={(id) => console.log(id)}
    />
  )
}

Props

PropTypeDefaultDescription
brandNamestring"Sono"Brand title in the header.
brandLogoReactNodeBot iconLogo beside the brand title.
navItemsAiSidebarNavItem[]defaultsQuick navigation rows (Images, Library, …).
moreNavItemsAiSidebarNavItem[]defaultsExtra items under the More menu.
chatHistoryGroupsAiSidebarChatGroup[]defaultsGrouped conversation lists.
activeChatIdstring"chat-1"Currently selected chat id.
userAiSidebarUserdefaultsName, email, avatar, and plan for the footer.
collapsedbooleanfalseCompact 64px icon rail.
searchQuerystring—Controlled search query (optional).
onNewChat() => void—New chat button callback.
onSelectChat(chatId: string) => void—Fired when a conversation is selected.
onToggleCollapse() => void—Expand / collapse control callback.
onPinChat / onRenameChat / onDeleteChatcallbacks—History item actions from the hover menu.
classNamestring—Optional class names on the root aside.