Thinking UI

Suggestion Chips

Starter prompts that cascade in and lift on hover.

Code

components/thinking-ui/suggestion-chips.tsx
"use client";

import { motion } from "motion/react";
import type { ReactNode } from "react";
import { useMotion } from "@/lib/motion";
import { cn } from "@/lib/utils";

export type Suggestion = string | { label: string; icon?: ReactNode };

export type SuggestionChipsProps = {
  suggestions: Suggestion[];
  onSelect?: (label: string) => void;
  className?: string;
};

export function SuggestionChips({ suggestions, onSelect, className }: SuggestionChipsProps) {
  const m = useMotion();

  return (
    <div className={cn("flex flex-wrap justify-center gap-2", className)}>
      {suggestions.map((s, i) => {
        const { label, icon } = typeof s === "string" ? { label: s, icon: undefined } : s;
        const enter = m.fadeUp(m.distance.md);
        return (
          <motion.button
            key={label}
            type="button"
            onClick={() => onSelect?.(label)}
            initial={enter.initial}
            animate={enter.animate}
            transition={{ ...m.spring("base"), delay: m.stagger(i) }}
            whileHover={{ y: -m.distance.sm / 2 }}
            whileTap={m.press}
            className="transition-ui inline-flex h-control items-center gap-2 rounded-chip bg-chip px-4 text-sm text-chip-fg shadow-bevel hover:bg-chip-hover hover:text-chip-fg-hover hover:shadow-bevel-hover"
          >
            {icon}
            {label}
          </motion.button>
        );
      })}
    </div>
  );
}

Motion notes

  • Chips enter one after another using the personality's stagger, so the row reads left to right.
  • Hover lifts by half the small distance token: a hint of depth, not a jump.
  • Pressing uses the personality's press scale, so Playful squishes and Precise barely moves.

Installation

  1. 1

    Install dependencies

    Terminal
    npm install motion clsx tailwind-merge
  2. 2

    Add the design tokens and motion system (once per project)

    Copy styles/tokens/*, lib/motion.tsx and lib/utils.ts from Get started.

  3. 3

    Paste the source into components/thinking-ui/suggestion-chips.tsx

    Copy it from the Code tab, or use Copy prompt to let your coding agent do all of this.

Usage

Example
<SuggestionChips
  suggestions={["Summarize this PDF", "Draft a reply"]}
  onSelect={send}
/>

Props

PropTypeDefaultDescription
suggestions(string | { label, icon? })[]—Prompts to show.
onSelect(label: string) => void—Called with the chosen label.