- Implementation
- Suggestion Props
- SuggestionList Props
Common Examples
To use a singleSuggestion, pass a required label and handle selection with onPress. Supply the label already localized; the component renders it verbatim.Suggestion list
UseSuggestionList 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
SetisDisabled 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
Suggestionuses its visiblelabelas its accessible name.SuggestionListexposes its chips as onerole="group"named by a localized label.- Users activate a focused suggestion with Enter or Space.