# Prompt Suggestion

A pill-shaped suggested-prompt chip shown above an empty chat input.

- Category: AI & Agents
- Page: https://wunderui.com/components/prompt-suggestion
- Tier: Core and Pro

## Install

Prompt Suggestion ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { PromptSuggestion } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
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

- [Slash Command Menu](https://wunderui.com/components/slash-command-menu) for commands opened by typing a slash, with an icon and a description
- [Button](https://wunderui.com/components/button) for an action of the page itself, such as Save or Export
- [Badge](https://wunderui.com/components/badge) for a label that is shown but not pressed

## Keyboard

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.

| Key | Action |
|---|---|
| `Tab` or `Shift+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. |
| `Enter` or `Space` | Presses the focused chip and calls `onClick`. |

## Behavior

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

- `PromptSuggestion`: 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.
- `Label`: 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

### When to use

- Use Prompt Suggestions on an empty chat or under an answer, to show what is possible. For commands opened by typing a slash, use Slash Command Menu.

### 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.
- Fill the box and move focus there when the text is a starting point. Send straight away only for a complete follow-up.
- Put the chips in a named group, such as Suggested prompts, so a screen reader announces what they are.
- 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 expect an icon or a description. For both, use the card layout or Slash Command Menu.

## API reference

### PromptSuggestion

| Prop | Type | Default | Description |
|---|---|---|---|
| children* | React.ReactNode |  | The text of the chip. It is also the accessible name, so write the full request. |
| className | string |  | Extra classes for the button, for example `flex flex-col items-start rounded-xl px-4 py-3 text-left` for a card. |
| icon | React.ReactNode |  | A 16 px mark before the label (an icon in its own colour, e.g. a tint-text class). |
| onClick | () => void |  | Called when the chip is pressed by click, Enter or Space. Fill the box or send the request here. |
| size | "default" \| "sm" | "default" | `sm` is the compact follow-up chip: 12 px text and tighter padding. |

## Examples

### Layout: a row, a stack, or cards with a description

### State: default, hover, pressed, focus

### Compact follow-up chips

## In context

### Empty chat: a click fills the box

Each chip puts its full request into the Prompt Input and moves focus there, so the person can edit before sending. Tab reaches the chips, Enter or Space picks one.

### Follow-ups: a click sends

Under an answer, a follow-up is a complete question, so a click sends it. The chips ignore clicks while a reply is on its way.

## For AI agents

`get_component("prompt-suggestion")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
