This widget is and is subject to change in minor versions.
Signature
Import
About this widget
Use thechatTrigger widget to render 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.
The chat widget 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
Options
The CSS Selector or
HTMLElement to insert the widget into.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
The templates to customize parts of the widget.
layout. Template for the trigger button layout. Receives the button props, includingopen,onClick, andtoggleIconComponent.icon. Template for the trigger button icon. Receives a parameter containing{ isOpen: boolean }for conditional rendering.
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.
button. CSS class to add to the button.
JavaScript
HTML output
HTML
ais-ChatToggleButton--open class.