Skip to content
ConversationSuggestionsMenu

Suggestions

Starter prompts and follow-ups as chips, rows or cards, with a scrolling chip row that fades only the edges hiding more.

Chips, a scrolling row and cards.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/suggestions.json

Usage

tsx
import { Suggestion, Suggestions } from "@/components/ui/chatcn/suggestions"

<Suggestions variant="rows" label="Follow-ups">
  <Suggestion onSelect={send}>Add the created_at index</Suggestion>
  <Suggestion value="Show me the diff for src/lib/runs.ts" onSelect={send}>
    Show me the diff
  </Suggestion>
</Suggestions>

Examples

Follow-ups

Show follow-ups only after the reply finishes streaming.

Rows after a finished reply.

Props

PropTypeNotes
variant"chips" | "rows" | "cards"Defaults to chips
scrollbooleanChips on one scrolling line with faded edges
labelstringHeading that also names the group
animatebooleanStagger in once on mount. Defaults to true
Suggestion.valuestringPassed to onSelect. Defaults to the label text
Suggestion.descriptionReactNodeSecond line for rows and cards
Suggestion.iconReactNodeA 14 to 16 px icon

Keyboard

KeyAction
TabMove between suggestions
Enter, SpacePick one

Accessibility

  • Suggestions are buttons in a group, named by label or Suggestions.
  • Chips grow to 44 px on touch screens.

Motion

  • Items rise 4 px and fade in, 40 ms apart, at most six of them, once. Re-renders never replay it.
  • Hover changes color and background only. Press scales to 0.97.