Suggestion
A prompt suggestion pill bar and clickable chip primitives built on Kinetic Button, with scrollable row or wrapped layouts and staggered blur reveal.
Selected: Summarize recent commits
Customize
Installation
npx shadcn@latest add @kinetic/suggestionUsage
Render Suggestion pills inside Suggestions and pass an onClick handler receiving the chosen prompt string.
import { Suggestion, Suggestions } from "@/components/kinetic/ui/suggestion";
const PROMPTS = [
"Summarize recent changes",
"Check reduced-motion rules",
"Generate unit test cases",
];
interface PromptStarterBarProps {
readonly onSelect: (prompt: string) => void;
}
export function PromptStarterBar({ onSelect }: PromptStarterBarProps) {
return (
<Suggestions layout="row">
{PROMPTS.map((item) => (
<Suggestion key={item} suggestion={item} onClick={onSelect} />
))}
</Suggestions>
);
}Row vs. wrap layouts
Use layout="row" (default) for a single-line horizontal scroll strip with unclipped focus rings, or layout="wrap" to flow chips across multiple rows. Dynamically appended chips are observed via MutationObserver and revealed smoothly with staggerReveal.
<Suggestions layout="wrap" staggerMs={95}>
<Suggestion suggestion="Explain spring damping" variant="secondary" />
<Suggestion suggestion="Compare token contrast" variant="outline" />
</Suggestions>Motion preferences
Suggestions applies staggerReveal (staggerMs: 95, blurPx: 8, speed: 0.45), while standalone Suggestion chips enter with directionalSwap. Reduced motion skips entrance blur and stagger delays cleanly.
API Reference
Suggestions
Scroll-safe prompt strip orchestrating staggered blur-fade reveal for initial and dynamically added chips.
| Prop | Type | Default | Description |
|---|---|---|---|
layout | "row" | "wrap" | "row" | Horizontal scroll row with unclipped focus ring padding, or multi-line wrap. |
animated / speed / blurPx / staggerMs | boolean / number / number / number | true / 0.45 / 8 / 95 | Enables stagger reveal, scales timing, sets blur radius (px), and configures step delay (ms). |
Suggestion
Kinetic Button pill chip with standalone directional enter when rendered outside Suggestions.
| Prop | Type | Default | Description |
|---|---|---|---|
suggestion / onClick | string / (suggestion: string) => void | - | Prompt label and callback receiving the selected string. |
variant / size | KineticButtonVariant / KineticButtonSize | "outline" / "sm" | Button variant and size preset forwarded to Kinetic Button. |
animated / speed / blurPx | boolean / number / number | true / 0.45 / 8 | Controls standalone directional entrance when not inside Suggestions. |