Prompt Suggestion
ProA rounded chip with a ready-made prompt, shown above an empty chat box or under an answer.
Playground
Installation
Prompt Suggestion comes with WunderUI Core and Pro, in the package from your plan. See the plans.
Then import what you need:
import { PromptSuggestion } from "@wunderui/react"Then use it:
import { useState } from "react"
import { PromptInput, PromptSuggestion } from "@wunderui/react"
export function EmptyChat() {
const [value, setValue] = useState("")
return (
<div className="flex flex-col gap-4">
<PromptSuggestion onClick={() => setValue("Summarize the Q3 report in three points.")}>
Summarize the Q3 report
</PromptSuggestion>
<PromptInput value={value} onValueChange={setValue} onSubmit={() => setValue("")} />
</div>
)
}Expected result: You should see one rounded chip above the box. Press it and the box fills with the full request.
When to use
Use Prompt Suggestion for
- An empty chat, to show what the assistant can do and give a first click
- Follow-up questions under an answer
- Ready-made requests for a task that is easy to describe, such as a summary or a translation
Use something else for
- Slash Command Menu for commands opened by typing a slash, with an icon and a description
- Button for an action of the page itself, such as Save or Export
- Badge for a label that is shown but not pressed
Layout
A wrapping row suits short requests, a stack suits longer ones, and a class can turn the chip into a card with a title and description. Wrap the set in a named group.
Nothing picked yet.
Nothing picked yet.
Nothing picked yet.
State
Hover fills the chip with the page colour, pressed uses the subtle fill, and keyboard focus draws the indigo border with a 2 px ring. There is no selected, disabled or loading state.
Newer props
size="sm" is the 12 px chip for follow-up questions under an answer.
Compact follow-up chips
Keyboard interactions
The chip is a native button, so the browser provides focus and activation. There is no arrow-key navigation: every chip is a tab stop.
- TaborShift+Tab
- Moves focus to the next or previous chip, in the order of the DOM. Focus shows as an indigo border with a 2 px ring.
- EnterorSpace
- Presses the focused chip and calls .
Behavior and motion
What the chip does when it is pressed and how it looks in each state.
- No built-in action
- The chip only calls its click handler. Filling the box or sending the request is yours, and the chip keeps no pressed or selected state.
- Fill or send
- Fill the Prompt Input and move focus into it when the chip is a starting point, so the person can edit. Send directly only for a complete request, such as a follow-up under an answer.
- Focus after a click
- A click leaves focus on the chip. If it fills the box, move focus to the box yourself, or a keyboard user has to tab back to it.
- Text only
- The children render inside the pill as given, so an icon or a second line is possible, but there is no icon or description prop. For a card look, pass your own classes.
- Long text
- The pill does not truncate: a long text wraps onto more lines inside the rounded shape. Keep each suggestion to one line, or use the card layout.
- Disabled
- There is no disabled option. To take the chips out while a reply is on its way, ignore the click or do not render them.
- States
- Hover fills the chip with the page colour and darkens the text, pressed uses the subtle fill, and focus draws the indigo border with a 2 px ring. All three change colour only.
- Motion
- Fill and text colour change quickly. Nothing moves or scales.
- Reduced motion
- No movement is involved, so reduced motion changes nothing: the colours still change, in the same short time.
Anatomy
The figure marks the chip. Its label is the chip text and has no part of its own.
- 1
A fully rounded button with a 1 px border, the card background and 14 px secondary text. It calls a click handler and takes a class name, nothing else.
The text of the chip, which is its accessible name and what the person reads, so write the full request. Longer text wraps inside the pill.
Best practices
- Do
Write each suggestion as the full request the click will use, such as Summarize the Q3 report. A bare label such as Report hides what happens.
- Do
Fill the box and move focus there when the text is a starting point. Send straight away only for a complete follow-up.
- Do
Put the chips in a named group, such as Suggested prompts, so a screen reader announces what they are.
- Do
Keep it to three or four chips. More turn the empty state into a menu.
- Don’t
Don't leave stale chips under an answer they no longer fit. Replace or remove them when the topic moves on.
- Don’t
Don't expect an icon or a description. For both, use the card layout or Slash Command Menu.
API reference
PromptSuggestion is a plain component, not a wrapper of a primitive. It takes the props below and no other element attributes.
A fully rounded button with a 1 px border, the card background and 14 px secondary text. It calls a click handler and takes a class name, nothing else.
| Prop | Type | Default | Description |
|---|---|---|---|
| children required | ReactNode | — | The text of the chip. It is also the accessible name, so write the full request. |
| onClick | () => void | — | Called when the chip is pressed by click, Enter or Space. Fill the box or send the request here. |
| className | string | — | Extra classes for the button, for example for a card. |
| icon | ReactNode | — | A 16 px mark before the label (an icon in its own colour, e.g. a tint-text class). |
| size | "default" | "sm" | "default" | is the compact follow-up chip: 12 px text and tighter padding. |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("prompt-suggestion")The full library index for assistants is at /llms.txt.
Related components
Commands
/summarizeSummarize the open thread/explainExplain the selected code/testWrite tests for the open file/translateTranslate the last reply/docsSearch the WunderUI docs↑↓ to move · ↵ to run · esc to close
AI & Agents4 stylesProSlash Command MenuThe popover that opens when someone types / in the prompt: commands with a short description, filtered as they type.