Skip to content
Sign upPro
Chat layoutsFocus chatMenu

Focus chat (Pro)

ProIncluded in $99

A centered, distraction free chat: while you type, the chrome fades and earlier turns step back; a small pointer movement brings them back.

ProA grant draft: while the question is typed the chrome and earlier turns step back, then the answer arrives.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/focus-chat

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

tsx
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

ProEverything showing, quiet while writing, and a failed answer.

Props

PropTypeNotes
messagesChatcnMessage[]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, onValueChangestringThe draft, controlled or not
onSend(text) => void
header, sidebar, footerReactNodeThe chrome that fades while typing
quiet, defaultQuiet, onQuietChangebooleanQuiet mode, controlled or not
dimWhileTypingbooleanTyping turns quiet on. Default true
disabledboolean
labelsPartial<FocusChatLabels>Every string, for translation

Keyboard

KeyAction
TypingQuiet mode comes on after a moment
EscapeBring the chrome back
Enter, Shift EnterSend, 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.