Skip to content
Sign upPro
Chat layoutsLauncher widgetMenu

Launcher widget (Pro)

ProIncluded in $99

The chat bubble for a website, done properly: unread count, a greeting that steps aside, and a panel that grows out of the launcher.

ProA bookkeeping site's pricing page: a greeting appears, the panel grows out of the launcher, and a plan question gets answered.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/launcher-widget

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 { 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

ProClosed with a greeting and unread, open with common questions, answered, a failed answer, and the start side.

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
open, defaultOpen, onOpenChangeboolean
title, subtitle, avatarReactNodeWho answers, and how fast
greeting, onGreetingDismissReactNode, () => voidA note beside the closed launcher
unreadnumberShown on the closed launcher and in its name
suggestionsstring[]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
disabledboolean
labelsPartial<LauncherWidgetLabels>Every string, for translation

Keyboard

KeyAction
Enter or Space on the launcherOpen or close the panel
EscapeClose the panel, focus back on the launcher
Enter, Shift EnterSend, 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.