Chat Widget
ProNewOne launcher for WhatsApp, Messenger, Telegram, Viber, LINE and more: branded chat, typed greeting and a button or multi-channel row that continues in the selected app.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| channel | ChatChannelThe messenger this widget opens. It sets the brand color, icon and button text. | "whatsapp" |
| contact | stringPhone number, username or page id on that channel, or a full URL. | "" |
| channels | ChatChannelLink[]Offer several messengers instead of one: the window ends in a row of brand buttons. | — |
| agent | ChatAgentWho the visitor is talking to, shown in the header. | { name: "Support", caption: "Typically replies within minutes" } |
| online | booleanShows the green dot on the avatar. | true |
| greeting | string | string[]Greeting, typed out one bubble at a time after the window opens. | "Hi there 👋\nHow can I help you?" |
| replyField | booleanLet visitors write their first message here; sending opens the channel with the text filled in where the channel supports it. Single channel only. | false |
| onSend | (text: string, channel: ChatChannel) => voidCalled with the text when the visitor sends from the reply field. | — |
| buttonLabel | stringText of the start-chat button. | — |
| layout | "floating" | "inline"`floating` pins a launcher to a corner of the viewport, `inline` renders the open window in the page. | "floating" |
| skin | "brand" | "plain"`brand` colors the header and wallpaper like the messenger, `plain` uses your theme's own surface and text colors. | "brand" |
| accent | stringAny CSS color, replacing the channel's own for the header, button and launcher. | — |
| launcher | "bubble" | "pill"Round icon button, or a pill with the label next to the icon. | "bubble" |
| launcherLabel | stringAccessible name of the launcher, and the visible text of the pill. | "Chat with us" |
| badge | numberUnread count on the launcher until the window is first opened. 0 hides it. | 1 |
| teaser | stringA short line that pops up beside the closed launcher to invite a click. | — |
| position | "bottom-right" | "bottom-left" | "bottom-right" |
| open | booleanControlled open state for the floating layout. | — |
| defaultOpen | boolean | false |
| onOpenChange | (open: boolean) => void | — |
| className | string | — |
Accessibility
- The launcher is a button that reports expanded state and its unread count; the window is a named, non-modal dialog so the page stays usable.
- Opening moves focus into the window; Escape or Close returns it to the launcher.
- Greetings arrive in a polite live log, and the typing dots read as “Maya is typing”.
- Configured channel links are named and restricted to web or matching app schemes; an unsafe contact has no interactive link.
- White text sits on a deepened shade of each brand color to keep its contrast; the typing dots and pop-in stop under reduced motion.