shadcn.io is not affiliated with official shadcn/ui
A row of short prompts sits above the message field, and a click sends one as it reads.
Use it for the first turn, when the reader doesn't know what to ask, and for follow-ups the agent can predict. Each suggestion is a Button with the prompt as its label, so there is no Suggestion component to install in React: the row is yours to edit. Keep each label short enough to read at a glance, and send the label as the message, word for word.
Installation
Suggestion is a pattern. The command adds the parts it's built from, Button and the scroll-fade utility, and the code to copy is the demo's.
Anatomy

Row (div, scroll-fade-x)
└── Button (one per suggestion)Usage
import { Button } from "@/components/ui/button";const suggestions = ["Add a dark mode toggle", "Fix the failing build"];
export function Suggestions(props: { onSend: (prompt: string) => void }) {
return (
<div className="scrollbar-none flex scroll-fade-x gap-2 overflow-x-auto overscroll-x-contain">
{suggestions.map((suggestion) => (
<Button
className="shrink-0"
key={suggestion}
onClick={() => props.onSend(suggestion)}
size="sm"
variant="outline"
>
{suggestion}
</Button>
))}
</div>
);
}Demos
Scrolling
Five suggestions in a column as narrow as a phone's composer, and a line that says which one was sent. The row scrolls sideways when the labels don't fit: scroll-fade-x fades the edge that has more to show and follows the reading direction, shrink-0 keeps each label on one line, and overscroll-x-contain stops a swipe at the end from moving the page. With three or four suggestions and the room to show them all, wrap the row (flex-wrap, no fade) instead.
AI SDK
The label is the message. Send it as it is.
import { useChat } from "@ai-sdk/react";
const { sendMessage, status } = useChat();
sendMessage({ text: suggestion });Hide or disable the row while a reply streams, so a second click doesn't queue a message the reader didn't mean to send: with the AI SDK, while status is submitted or streaming.
Migrating from AI SDK Elements
If you added Suggestion from AI SDK Elementscomponents/ai-elements/suggestion.tsx wrapper. Paste this prompt into your coding agent to rebuild it on Button. Every export keeps its name and props, so the code that uses it keeps working.
Migrate components/ai-elements/suggestion.tsx from AI SDK Elements to the shadcn.io Button component.
Keep every export, with the same name and props, so the code that imports it keeps working. Only change how each part renders.
1. Read https://kit.dev/ui/suggestion.md and build Suggestion the same way. If the project hasn't got Button and the scroll-fade utility, run the command in its Installation section.
2. Rebuild each part:
- Suggestions renders a div with className="scrollbar-none flex scroll-fade-x gap-2 overflow-x-auto overscroll-x-contain", instead of a ScrollArea. Change SuggestionsProps to ComponentProps<"div">.
- Suggestion renders a Button with variant="outline", size="sm" and className="shrink-0". Keep onClick, called with the suggestion.
3. Remove the imports the file no longer uses.
4. Run the type checker and fix any errors.FAQ
What does installing Suggestion add in React?
Button and the scroll-fade utility, the two parts the row is built from. Suggestion is a pattern, so no suggestion file lands in your ui folder: copy the demo's code into your own component and change the labels. The command uses the shadcn CLI.
What should a suggestion send?
Its label, word for word, as the reader's message. The reader decides from what the button says, so a hidden longer prompt would send something they never read. If a suggestion needs more context, put it in the label or in the system prompt.
How many suggestions should the row show?
Three to six. Fewer than three reads as a menu with gaps, and past six the reader scrolls instead of choosing. When they all fit, wrap the row with flex-wrap and drop the fade; when they don't, keep one scrolling line.
Why does the row fade at its edges?
scroll-fade-x masks the edge that has more to show, so a cut-off label reads as more to scroll rather than a broken layout. The fade follows the reading direction, so in a right-to-left page it starts on the right. It is CSS only, and an edge with nothing past it stays sharp.
What happens if the reader clicks while a reply streams?
The demo answers at once, but a real agent takes a while, and a second click would send another message mid-reply. Hide or disable the row while the chat's status is submitted or streaming, and bring it back with the next set of suggestions once the reply ends.
Can the reader reach the suggestions with the keyboard?
Yes. Each suggestion is a Button, so Tab moves through them in order, and Enter or Space sends the one in focus. The row scrolls to keep the focused button in view.
Is this the same as AI SDK Elements' Suggestion?
It does the same job without a wrapper: Suggestions was a ScrollArea and Suggestion a Button, and here the row is a div with the scroll-fade utility around plain Buttons. The Migrating from AI SDK Elements section has a prompt that rebuilds the old file on these parts and keeps its exports.
API Reference
Suggestion has no props of its own. Each suggestion is a Button: variant, size and the click handler are Button's. The row is a div with the scroll-fade utility's scroll-fade-x class.













