Componentmedia1.17 KB gzipZero dependencies
ChatWindow
Full chat panel with message list, input bar, and typing indicator slot.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add chat-windowOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { ChatWindow } from "@/components/ui/chat-window"; <ChatWindow messages={messages} onSend={onSend} typing={typing} />Source code
chat-window.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxchat-window.tsx158 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface ChatMessage { id: string; author: string; initials: string; body: string; time?: string; direction: "incoming" | "outgoing";} export interface ChatWindowProps extends React.HTMLAttributes<HTMLDivElement> { messages?: ChatMessage[]; onSend?: (body: string) => void; typing?: boolean;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { ChatWindow } from "@/components/ui/chat-window"; <ChatWindow />| Prop | Type | Description |
|---|---|---|
| messages | ChatMessage[] | Configures messages. (Default: []) |
| onSend | (body: string) => void | Callback invoked on send. |
| typing | boolean | Toggles typing. (Default: false) |
| autoFocus | boolean | Toggles auto focus. (Default: false) |
| placeholder | string | Placeholder text shown when empty. (Default: "Message...") |