Suggestion Chips
A set of follow-up prompts that users send with one tap.
Usage
Basic
Loading demo...
Vertical Follow-up List
layout="list" turns the chips into rule-separated rows, each led by a return arrow.
Usable, with the sources, once the prose finishes
Loading demo...
Best Practices
- Offer three to five suggestions.
- Word them as a user would say them ("Add unit tests"), not as feature names ("Test generation").
- Clear or replace the list after a tap so the same prompt can't be sent twice.
- Use stable ids rather than the label text, so analytics and de-duplication survive copy changes.
- End a settled answer with
layout="list".
API Reference
Props
| Name | Type | Default | Description |
|---|---|---|---|
suggestions | AiSuggestion[] | — | The suggestions, each { id: string, text: string }. Required. |
layout | 'wrap' | 'list' | 'wrap' | list stacks them into rule-separated rows with a return glyph. |
Events
| Name | Payload | Description |
|---|---|---|
select | (suggestion: AiSuggestion) | Fires when a chip is clicked, with the whole suggestion. |
Overview
- Nothing renders when
suggestionsis empty. - Each chip is keyed by
id; keep ids unique within a set. - The component holds no selection state and doesn't remove a suggestion after a tap.
wrapscrolls horizontally on overflow, with a hidden scrollbar and edge masks that signal the overflow.listrows stagger in by position, 90ms apart; under reduced motion they simply appear.- The container is
role="list"and each chiprole="listitem", which overrides the button semantics; add surrounding text where button semantics matter.