Skip to main content
This widget is and is subject to change in minor versions.
For more information, see Agent Studio.
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

floating
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
onClick
() => void
A callback called when the trigger is clicked, in addition to opening or closing the chat.
JavaScript
toggleIconComponent
(props: { isOpen: boolean }) => JSX.Element
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
classNames
Partial<ChatToggleButtonClassNames>
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
...props
React.ComponentProps<'button'>
Any <button> prop to forward to the root element of the widget.
JavaScript

HTML output

HTML
When the chat is open, the button also gets the ais-ChatToggleButton--open class.
Last modified on July 10, 2026