Skip to main content
This widget is and is subject to change in minor versions.
For more information, see Agent Studio.
Signature

Import

About this widget

Use the chatTrigger 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

string | HTMLElement
required
The CSS Selector or HTMLElement to insert the widget into.
boolean
default:true
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
object
The templates to customize parts of the widget.
  • layout. Template for the trigger button layout. Receives the button props, including open, onClick, and toggleIconComponent.
  • icon. Template for the trigger button icon. Receives a parameter containing { isOpen: boolean } for conditional rendering.
JavaScript
object
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
When the chat is open, the button also gets the ais-ChatToggleButton--open class.
Last modified on July 22, 2026