Prompt Suggestions
Offer prompt starters a person can send with one click, as chips, a scrolling row, or a list.
Overview
Prompt Suggestions shows a few things a person could ask next. Choosing one calls onSelect with its prompt. Sending it, or putting it in the composer first, is your application's work.
It renders the suggestions you pass. Use it under a reply, above a composer, or inside Chat Welcome on a new conversation.
Use Streaming Text's follow-ups for prompts that continue one reply, and Prompt Suggestions for starters that stand on their own.
Anatomy
- SuggestionA button with an optional icon and a short label
Behavior
Prompt and label
The chip shows label. When the prompt to send is longer, pass it as prompt; onSelect receives the suggestion with prompt filled in from the label when you leave it out.
Layouts
wrap flows the chips onto more lines. scroll keeps them on one line that scrolls sideways, for a narrow composer. list stacks them as full-width rows in one block, for longer prompts.
Disabled
disabled turns every suggestion off, such as while a reply is streaming.
Accessibility
The suggestions are a list of buttons named by their labels, and the list is named "Suggested prompts". They take one stop in the Tab order; the arrow keys move between them. Icons are decorative.
Installation
Usage
import { PromptSuggestions } from "@/components/ai/prompt-suggestions"
<PromptSuggestions
suggestions={[
{ id: "late", label: "Find late invoices", prompt: "Which invoices are more than 30 days late?" },
{ id: "trend", label: "Chart this month's revenue" },
]}
onSelect={(suggestion) => chat.send(suggestion.prompt)}
disabled={chat.status === "streaming"}
/>Examples
Scrolling row
One line that scrolls sideways.
List
Full-width rows in one block.
API reference
PromptSuggestions
Accepts native ul props beyond those listed.