This widget is and is subject to change in minor versions.
Signature
Import
JavaScript
About this widget
<ChatTrigger> renders a button that opens the <Chat> widget’s overlay.
By default, it’s a floating action button anchored to the bottom-right of the viewport.
<Chat> doesn’t render a way to open it on its own, so pair it with <ChatTrigger> unless you provide another entry point such as AI mode on a SearchBox or an inline layout.
See also: Agent Studio
Examples
JavaScript
Props
Whether to render the button as a floating action button anchored to the bottom-right of the viewport. Set it to
false to render an inline button that flows with surrounding content.JavaScript
A callback called when the trigger is clicked, in addition to opening or closing the chat.
JavaScript
A component to replace the default icon. It receives a prop containing
{ isOpen: boolean } for conditional rendering—for example, to show a different icon when the chat is open.JavaScript
The CSS classes you can override and pass to the widget’s elements.
It’s useful to style widgets with class-based CSS frameworks like Bootstrap or Tailwind CSS.
root. The root element of the widget (the button).
JavaScript
Any
<button> prop to forward to the root element of the widget.JavaScript
HTML output
HTML
ais-ChatToggleButton--open class.