Skip to Content

Chat Dock

Floating chat widget launcher that opens a docked support chat panel built on a dialog, pinned to the viewport or a container, with optional scrim and header, body and footer parts.

View as Markdown
pnpm dlx shadcn add @01orbital/chat-dock

The example also uses chat-composer, chat-conversation, chat-message, chat-response and message-scroller. Install them too:

pnpm dlx shadcn add @01orbital/chat-composer @01orbital/chat-conversation @01orbital/chat-message @01orbital/chat-response @01orbital/message-scroller

Usage

import { ChatDock } from "@/components/chat/chat-dock"

Anatomy

Chat Dock is built from 5 parts. In the example they nest like this:

ChatDock
├─ ChatDockHeader
│  └─ ChatDockTitle
├─ ChatDockBody
└─ ChatDockFooter
  • ChatDock: A floating chat: a round launcher in the corner that opens a chat panel above it. Put ChatDockHeader, ChatDockBody and ChatDockFooter inside.
  • ChatDockHeader: The panel's top bar: your title on the left and a close button on the right.
  • ChatDockTitle: The panel's title, which also names the dialog for screen readers.
  • ChatDockBody: The panel's middle, which fills the space between header and footer; put the conversation here.
  • ChatDockFooter: The panel's bottom bar, above a thin rule; put the composer here.

API reference

ChatDock

A floating chat: a round launcher in the corner that opens a chat panel above it. Put ChatDockHeader, ChatDockBody and ChatDockFooter inside.

Prop

Type

ChatDockHeader

The panel's top bar: your title on the left and a close button on the right.

It accepts the HTML attributes of the element it renders.

ChatDockTitle

The panel's title, which also names the dialog for screen readers.

It accepts the props of the Base UI part it wraps, and the HTML attributes of the element it renders.

ChatDockBody

The panel's middle, which fills the space between header and footer; put the conversation here.

It accepts the HTML attributes of the element it renders.

The panel's bottom bar, above a thin rule; put the composer here.

It accepts the HTML attributes of the element it renders.

Dependencies

npm: @base-ui/react, @phosphor-icons/react, cn. The CLI installs them for you. cn merges Tailwind class names, in place of clsx and tailwind-merge.

Registry pieces it installs with it: