Skip to content

ChatMinimal Component

A minimal chat component without history sidebar.

Import

tsx
import { ChatMinimal } from "@cognipeer/chat-ui";

Usage

tsx
<ChatMinimal
  baseUrl="/api/agents"
  agentId="assistant"
/>

Props

Same as Chat except:

  • No showHistory prop (always hidden)
  • No history-related callbacks

Required Props

PropTypeDescription
baseUrlstringBase URL for the agent server API
agentIdstringID of the agent to chat with

Optional Props

PropTypeDefaultDescription
theme"dark" | "light""dark"Theme mode
themeColorsThemeColors-Custom theme colors
authorizationstring-Authorization header
headersRecord<string, string>-Custom headers
conversationIdstring-Conversation ID
streamingbooleantrueEnable streaming
enableFileUploadbooleantrueEnable file uploads
classNamestring-Container class name

Examples

Basic

tsx
<ChatMinimal
  baseUrl="/api/agents"
  agentId="assistant"
  theme="dark"
/>

Embedded in Page

tsx
function ProductPage() {
  return (
    <div className="flex">
      <main className="flex-1">
        {/* Product content */}
      </main>
      
      <aside className="w-96 h-screen border-l">
        <ChatMinimal
          baseUrl="/api/agents"
          agentId="product-helper"
          theme="light"
        />
      </aside>
    </div>
  );
}

With Fixed Conversation

tsx
<ChatMinimal
  baseUrl="/api/agents"
  agentId="assistant"
  conversationId="conv-123"
/>

Custom Styling

tsx
<ChatMinimal
  baseUrl="/api/agents"
  agentId="assistant"
  className="rounded-lg border"
  themeColors={{
    bgPrimary: "#1a1a2e",
    accentPrimary: "#e94560",
  }}
/>

When to Use

Use ChatMinimal when you:

  • Don't need conversation history
  • Are embedding chat in a larger UI
  • Want a simpler interface
  • Are building a widget

Use Chat when you:

  • Need conversation history
  • Want full-featured chat
  • Are building a standalone chat page

Released under the MIT License.