Skip to content
Agent UI
Pickers & navigationConversationSidebar

Conversation Sidebar

Chat history rail with active state, timestamps, and a new-chat action.

ConversationSidebar ships with a full API table, a copyable example, and accessibility notes.

tsx

Installation

Install the package once, then import ConversationSidebar from its direct entry point or from the root.

bash
pnpm add @agent-ui/react
tsx
import { ConversationSidebar } from "@agent-ui/react/conversation-sidebar";

Tailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.

Usage

The example below is the same code that renders the preview. Copy it, swap in your own handlers, and ship.

tsx
import { ConversationSidebar } from "@agent-ui/react";
 
<ConversationSidebar
conversations={conversations}
activeId={activeId}
onSelect={openConversation}
onNew={newChat}
/>

API reference

Every prop ConversationSidebar accepts, its type, default, and behaviour.

API reference for this component
NameTypeDefaultDescription
conversationsConversation[]—History items with id, title, updatedAt.
activeIdstring—Highlighted conversation.
onSelect(conv: Conversation) => void—Selection callback.
onNew() => void—New chat callback.
classNamestring—Merged onto the nav element.

Accessibility

Rendered as a labelled navigation landmark with aria-current on the active item.
Use it with the rest of the library

ConversationSidebar composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.

8 lines · copy-ready