Skip to main content

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

Speed0.45
Blur reveal (px)8
Stagger (ms)95

Installation

npx shadcn@latest add @kinetic/suggestion

Usage

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.

PropTypeDefaultDescription
layout"row" | "wrap""row"Horizontal scroll row with unclipped focus ring padding, or multi-line wrap.
animated / speed / blurPx / staggerMsboolean / number / number / numbertrue / 0.45 / 8 / 95Enables 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.

PropTypeDefaultDescription
suggestion / onClickstring / (suggestion: string) => void-Prompt label and callback receiving the selected string.
variant / sizeKineticButtonVariant / KineticButtonSize"outline" / "sm"Button variant and size preset forwarded to Kinetic Button.
animated / speed / blurPxboolean / number / numbertrue / 0.45 / 8Controls standalone directional entrance when not inside Suggestions.