ChatGPT Shell
ChatGPTShell combines ConversationSidebar and ChatShell behind one API. Use it when you want the familiar left-rail chat layout without assembling the pieces yourself.
ChatGPTShell ships with a full API table, a copyable example, and accessibility notes.
Installation
Install the package once, then import ChatGPTShell from its direct entry point or from the root.
pnpm add @agent-ui/reactimport { ChatGPTShell } from "@agent-ui/react";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.
import { ChatGPTShell } from "@agent-ui/react"; <ChatGPTShell conversations={conversations} activeId={activeId} messages={messages} isStreaming={isStreaming} onSend={send} onStop={stop} onSelectConversation={select} onNewChat={create}/>API reference
Every prop ChatGPTShell accepts, its type, default, and behaviour.
| Name | Type | Default | Description |
|---|---|---|---|
| conversations | { id; title; updatedAt }[] | — | History rail items. |
| activeId | string | — | Active conversation id. |
| messages | ChatMessage[] | — | Transcript. |
| isStreaming | boolean | false | Shows typing and stop states. |
| error | string | null | — | Inline error banner. |
| onSend | (text: string) => void | — | Composer handler. |
| onStop | () => void | — | Abort handler. |
| onSelectConversation | (id: string) => void | — | History selection. |
| onNewChat | () => void | — | New chat action. |
| className | string | — | Merged onto the shell. |
Accessibility
ChatGPTShell composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.
12 lines · copy-ready