Saltar al contenido principal

AI floating button

Usage​

Overview​

The AI floating button provides a standardized trigger for the AI chat interface. It is used to toggle the visibility of the chat window.

When to use​

Use the AI floating button as a persistent, always-available entry point to AI experiences across pages.

When not to use​

Don't use the AI floating button to perform a specific AI action in context. Instead, use an AI button for those task-level actions (inside cards, chat, or panels).

Formatting​

Anatomy​

Anatomy of an AI floating button including default and inverse variants

AI floating buttons consist of the following elements:

  1. Default AI floating buttons display containers (A) around an icon (B).
  2. Inverse AI floating buttons display containers (A) around an icon (B) with an outline (C).

Placement​

Place the button in the bottom-right corner of the screen so users can find it quickly. Use a high z-index so the button floats above all other content and isn't clipped.

Do place the AI floating button in the bottom-right corner of the screen.
Don't place the AI floating button inline in the header. It's a floating control that sits in a fixed bottom-right position on the screen.

Accessibility​

The AI floating button component is an icon-only button used to toggle the visibility of the AI chat interface.

This component is designed to meet WCAG 2.1 AA accessibility guidelines. Non-textual content that needs to convey meaning (the icon) and the keyboard focus indicator have a contrast ratio of at least 3:1 with their adjacent colors.

However, changes made by the content author or the specific implementation context can affect accessibility conformance.

Follow the guidance below and refer to the WAI-ARIA Authoring Practices Guide when using this component in your applications:

  • Labels: Provide a descriptive label using the label prop (for example, label="Toggle AI chat"), which the component renders as an aria-label. This ensures screen readers identify the button correctly immediately upon focus.
  • State indication: Because this button controls a collapsible window, use the aria-expanded attribute to indicate state. Set aria-expanded="true" when the chat is open, and aria-expanded="false" when it is closed.
  • Focus management: When the user selects this button to open the chat, focus must move to the chat window. When the user closes the chat, focus must return to this button.
  • Zoom and layout: Ensure the floating button does not obscure essential content, interactive elements, or scrollbars, especially when the page is zoomed to 400%.