AI Right Sidebar

AI
Context

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 AM

Features

  • 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.

// Example usage
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

PropTypeDefaultDescription
isOpenbooleantrueWhether sidebar is open
onToggle() => void-Called when sidebar opens/closes
width'narrow' | 'medium' | 'wide''medium'Sidebar width preset
resizablebooleantrueEnable drag-to-resize
pinnablebooleantrueShow pin button
sectionsstring[]['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