Ballmac UI home

Suggestion Chips

Starter prompts for an empty chat or follow-ups after a reply, as wrapping pills, a swipeable row with faded edges, or cards with descriptions, plus loading and refresh states.

Choose a suggestion to send it.

Installation

$ pnpm dlx shadcn@latest add @ballmac/suggestion-chips

Usage

import { SuggestionChips } from "@/components/ballmac/suggestion-chips"

The full example is in the Code tab above.

Examples

Starter cards

API reference

PropTypeDefault
suggestions*

The prompts to offer.

Suggestion[]—
onSelect

Called with the prompt text and the suggestion that was chosen.

(prompt: string, suggestion: Suggestion) => void—
variant

"pills" wraps onto several lines, "scroll" keeps one swipeable row with faded edges, "cards" is a grid with descriptions.

"pills" | "scroll" | "cards""pills"
label

Accessible name of the group.

string—
onRefresh

When set, a refresh button appears after the chips.

() => void—
refreshLabel

Accessible name of the refresh button.

string—
disabled

Disables every chip, for example while a reply is streaming.

booleanfalse
loading

Shows placeholder chips while suggestions load.

booleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Tab / Shift+TabMoves between chips
Enter / SpaceSends the chosen prompt
Reduced motionChips fade in without sliding

Use with AI

suggestions is an array of { label, prompt?, description?, icon? }. onSelect receives the prompt text. variant is pills | scroll | cards. loading shows placeholders and onRefresh adds a shuffle button. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Suggestion Chips (@ballmac/suggestion-chips) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Empty state of a chat with example questions
  • Follow-up questions under an answer

Not for

  • Filtering a list (use filter-chips or tabs)
  • Free-form input; use prompt-input

Registry JSON: https://ui.ballmac.com/r/suggestion-chips.json

Credits

Free to use in personal and commercial projects.