Focus chat (Pro)
ProIncluded in $99A centered, distraction free chat: while you type, the chrome fades and earlier turns step back; a small pointer movement brings them back.
On this page
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { FocusChat } from "@/components/ui/chatcn/pro/focus-chat"
<FocusChat
header={<ChatTitle />}
sidebar={<ChatList />}
footer={`${wordCount} words`}
messages={messages}
status={status}
onSend={send}
/>For writing and long questions, where the interface should get out of the way. A moment after typing starts, the header, side column and hints fade, and every turn before the latest question dims, so the latest exchange and the draft are all that stays at full strength. A small real pointer movement (not the jitter of a resting hand), leaving the input or Escape brings everything back. Only opacity changes, so nothing shifts under the cursor. Turn the automatic behaviour off with dimWhileTyping={false} and drive quiet yourself, for example from a focus mode shortcut.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
messages | ChatcnMessage[] | The thread, in the kit's message contract |
status, error, onStop, onRetry | "ready" | "submitted" | "streaming" | "error" | Send becomes Stop while it streams; an error offers Try again |
value, defaultValue, onValueChange | string | The draft, controlled or not |
onSend | (text) => void | |
header, sidebar, footer | ReactNode | The chrome that fades while typing |
quiet, defaultQuiet, onQuietChange | boolean | Quiet mode, controlled or not |
dimWhileTyping | boolean | Typing turns quiet on. Default true |
disabled | boolean | |
labels | Partial<FocusChatLabels> | Every string, for translation |
Keyboard
| Key | Action |
|---|---|
| Typing | Quiet mode comes on after a moment |
| Escape | Bring the chrome back |
| Enter, Shift Enter | Send, new line |
Accessibility
- Faded chrome is hidden from assistive tech and cannot be clicked while quiet, so nothing invisible is focusable.
- A polite note says how to bring everything back.
- Dimmed turns stay in the reading order at full contrast for screen readers.
Motion
Chrome fades out over 500 ms and back in over 200 ms, so returning feels immediate. Nothing moves. Under reduced motion the changes are instant.