Skip to main content

Common Examples

To use a single Suggestion, pass a required label and handle selection with onPress. Supply the label already localized; the component renders it verbatim.

Suggestion list

Use SuggestionList for a wrapping group of chips. Each string in suggestions becomes a Suggestion. onSelect receives the selected string and index.The list does not enforce content limits. Keep the set to three suggestions of about 40 characters each.

Wrapping

Suggestions wrap to new lines when the container runs out of space.

Disabled

Set isDisabled on a single Suggestion to block selection.

Internationalization

Suggestion labels are consumer content and must be localized before they are passed to the component. SuggestionList uses ai-kit.suggestionList.label for its default group name. Pass aria-label to override it, or mount AiKitIntlProvider inside CartoTheme to override the message globally.

React Accessibility

  • Suggestion uses its visible label as its accessible name.
  • SuggestionList exposes its chips as one role="group" named by a localized label.
  • Users activate a focused suggestion with Enter or Space.
Last modified on August 28, 2026