Things to ask in an empty AI conversation: chips, one scrolling row, or cards with an icon and a line.
$ pnpm dlx shadcn@latest add https://dashral.com/r/prompt-suggestions.jsonInstallation
$ pnpm dlx shadcn@latest add https://dashral.com/r/prompt-suggestions.jsonAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:
{
"registries": {
"@dashral": "https://dashral.com/r/{name}.json"
}
}Then add components by name:
$ pnpm dlx shadcn@latest add @dashral/prompt-suggestionsUsage
import { PromptSuggestions } from "@/components/dashral/prompt-suggestions"
<PromptSuggestions
suggestions={["Summarize this week's sales", "Which invoices are overdue?", "Draft a reply to the latest ticket"]}
onSelect={(prompt) => api.chat.send(prompt)}
/>Examples
API reference
PromptSuggestions
Also takes every prop of <div>(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
suggestions | (string | { label, prompt?, description?, icon?, disabled? })[]Required. A string is its own prompt. | — |
onSelect | (prompt: string) => voidCalled with the prompt of the one picked. | — |
variant | "chips" | "cards"Round chips, or a grid of cards with an icon, a title and a line. | "chips" |
scroll | booleanChips in one row that scrolls sideways, its edges fading, instead of wrapping. | false |
aria-label | stringNames the group. | "Suggestions" |
classNames | { item?, icon?, label?, description? }Classes for each part. | — |
className | stringExtra classes, merged with cn() so yours win. | — |
Keyboard
| Keys | Action |
|---|---|
| Tab | Each suggestion in turn |
| EnterorSpace | Pick it |
Accessibility
- A group of buttons, named Suggestions; each button reads its label (and, as a card, its line).
- Scrolling chips still reach every one with Tab: focusing a chip scrolls it into view.
Motion
- Colors ease in on hover over --duration-fast; a card's arrow nudges toward its corner, and stays put with reduced motion.