SuggestionChips

Prompt suggestions that float in one after another. Picking one pops it and the rest step back. AI.

Open playground

About

SuggestionChips is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { SuggestionChips } from "@ashutoshswamy/smoui" and set suggestions, onPick.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { SuggestionChips } from "@ashutoshswamy/smoui";

<SuggestionChips suggestions={["Summarise this page", "Write a haiku"]} onPick={(t) => send(t)} />

Props 2

suggestions

Chip labels.

string[]
onPick

Called when one is chosen.

(text: string) => void