AI Right Sidebar
Collapsible right sidebar for AI chat interfaces (Perplexity Comet-style). Non-modal, persistent sidebar with context selection, conversation history, and settings without blocking main content.
Live Demo Active
The AI Right Sidebar is live on the right side of this page. Try collapsing and expanding it!
Interactive Preview
Full-featured AI sidebar with chat, context, history, and settings tabs
Main Chat Area
This is your main chat interface. The sidebar on the right provides context selection, conversation history, and settings without blocking the main content.
Non-modal: The sidebar is inline and the main content area adjusts when it expands or collapses.
Resizable: Drag the left edge of the sidebar to resize it (narrow, medium, wide).
Pinnable: Click the pin icon to keep the sidebar always open.
AI Assistant
Hi! I can help you with information about the current context. What would you like to know?
10:32 AMFeatures
- Non-modal design: Sidebar doesn't overlay content, main area adjusts when sidebar opens/closes
- Resizable width: Drag to resize or choose from narrow (280px), medium (360px), wide (480px)
- Pinnable: Pin the sidebar open to prevent auto-collapse
- Multi-section tabs: Chat, Context, History, and Settings in one interface
- Context management: Select and manage active resources (web search, knowledge base, files)
- Conversation history: Access previous chats with timestamps
- Smooth transitions: Animated open/close with CSS transitions
Installation
This component creates a Perplexity Comet-style collapsible sidebar for AI chat interfaces. Perfect for providing context, history, and settings without blocking the main content.
import { AIRightSidebar } from '@/components/ui/ai-right-sidebar'
function ChatInterface() {
const [isOpen, setIsOpen] = useState(true)
return (
<div className="flex h-screen">
<main className="flex-1">
{/* Your main content */}
</main>
<AIRightSidebar
isOpen={isOpen}
onToggle={() => setIsOpen(true)}
/>
</div>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| isOpen | boolean | true | Whether sidebar is open |
| onToggle | () => void | - | Called when sidebar opens/closes |
| width | 'narrow' | 'medium' | 'wide' | 'medium' | Sidebar width preset |
| resizable | boolean | true | Enable drag-to-resize |
| pinnable | boolean | true | Show pin button |
| sections | string[] | ['chat', 'context', 'history', 'settings'] | Available tab sections |
AI Assistant
Hi! I can help you with information about the current context. What would you like to know?
10:32 AM