Launcher widget (Pro)
ProIncluded in $99The chat bubble for a website, done properly: unread count, a greeting that steps aside, and a panel that grows out of the launcher.
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 { LauncherWidget } from "@/components/ui/chatcn/pro/launcher-widget"
<LauncherWidget
title="Saltmarsh"
subtitle="Answers right away, a person within a working day"
greeting="Choosing a plan? Ask me anything about them."
unread={unread}
messages={messages}
status={status}
onSend={send}
/>Closed, it is a launcher in the bottom corner with an unread count, and an optional greeting beside it that the reader can open or dismiss. Open, the panel grows out of the launcher's corner on the kit's spring, and the launcher's glyph turns into a chevron that closes it from the same spot, so opening and closing happen in one place. On a host narrower than 520 px the panel becomes a full height sheet. The subtitle is the place to be honest about who answers and how fast. placement="contained" keeps it inside its parent for dashboards and previews; the default floats over the viewport like a site widget.
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 | |
open, defaultOpen, onOpenChange | boolean | |
title, subtitle, avatar | ReactNode | Who answers, and how fast |
greeting, onGreetingDismiss | ReactNode, () => void | A note beside the closed launcher |
unread | number | Shown on the closed launcher and in its name |
suggestions | string[] | Common questions in the empty state |
side | "start" | "end" | Which bottom corner. Default the inline end |
placement | "fixed" | "contained" | Over the viewport, or inside the parent |
disabled | boolean | |
labels | Partial<LauncherWidgetLabels> | Every string, for translation |
Keyboard
| Key | Action |
|---|---|
| Enter or Space on the launcher | Open or close the panel |
| Escape | Close the panel, focus back on the launcher |
| Enter, Shift Enter | Send, new line |
Accessibility
- The launcher says whether it opens or closes and how many replies are unread, and reports its expanded state.
- Closed, the panel is inert, so focus and screen readers never land in it.
- Opening moves focus to the input; closing returns it to the launcher.
- The unread count is a blue info mark with the number in text, never color alone.
Motion
The panel scales up from the launcher's corner on the kit's spring and fades; closing plays it back faster. The launcher's glyph crossfades with a small turn. On phones the sheet rises 24 px instead. Under reduced motion everything fades in place.