Signature
Import
- Component
- Plugin
To ensure optimal bundle sizes,
see Optimize build size.
Vue
About this widget
Theais-chat-trigger widget renders a button that opens and closes the ais-chat widget.
By default, the button floats in the bottom-right corner of the viewport.
Add ais-chat-trigger when using the overlay or side-panel layout.
The inline layout doesn’t need a trigger.
See also: Agent Studio
Examples
Vue
Props
boolean
default:true
By default, the trigger is a floating button.
Set
floating to false to render an inline button that flows with surrounding content.Vue
object | (props: { isOpen: boolean }) => VNode
A Vue component or render function to replace the default icon.
It receives an
isOpen Boolean prop so it can show different icons when the chat opens or closes.Vue
object
default:"{}"
object
A dictionary of translations to customize the button’s accessible label, which screen readers announce.
openLabel(string). The accessible label when the chat isn’t open. The default isOpen chat.closeLabel(string). The accessible label when the chat is open. The default isClose chat.
Vue
Events
() => void
The widget emits a
click event after opening or closing the chat.Vue
HTML output
HTML
ais-ChatToggleButton--open class, and its aria-label becomes Close chat.