{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "suggested-prompts",
  "title": "Suggested prompts",
  "description": "Ready-made things to ask an AI — chips for follow-ups under an answer, cards for starters on an empty page, a list in a narrow panel. Picking one fills the composer; it never sends.",
  "registryDependencies": [
    "https://www.quilldesignsystem.com/r/icon.json"
  ],
  "files": [
    {
      "path": "registry/lib/suggested-prompts.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { Icon } from '@/components/ui/icon'\nimport { cn } from '@/lib/utils'\n\nexport type Suggestion = {\n  /** What the button says. */\n  label: string\n  /** A second line, shown in the cards layout. */\n  detail?: string\n  /** What goes into the composer; defaults to the label. */\n  prompt?: string\n}\n\n/** Ready-made things to ask an AI — chips for follow-ups under an answer, cards for starters on an empty page, a list in a narrow panel. Picking one fills the composer; it never sends. */\nexport function SuggestedPrompts({\n  suggestions, layout = 'chips', onPick, label = 'Suggestions', className,\n}: {\n  suggestions: Suggestion[]\n  layout?: 'chips' | 'cards' | 'list'\n  onPick: (prompt: string) => void\n  label?: string\n  className?: string\n}) {\n  const pick = (s: Suggestion) => onPick(s.prompt ?? s.label)\n  const list = {\n    chips: 'flex flex-wrap gap-1.5',\n    cards: 'grid grid-cols-2 gap-2 sm:grid-cols-4',\n    list: 'grid [&>li:last-child>button]:border-b',\n  }[layout]\n  return (\n    <ul aria-label={label} data-slot=\"suggested-prompts\" data-layout={layout} className={cn(list, className)}>\n      {suggestions.map((s, index) => (\n        // The index keeps two suggestions with the same label apart; the list is never reordered, so it is a stable key.\n        <li key={`${index}-${s.label}`}>\n          {layout === 'cards' ? (\n            <button type=\"button\" onClick={() => pick(s)}\n              className=\"grid w-full gap-0.5 rounded-lg border border-border bg-card px-3 py-2.5 text-left hover:border-input outline-hidden focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\">\n              <span className=\"text-sm font-semibold\">{s.label}</span>\n              {s.detail ? <span className=\"truncate text-xs text-muted-foreground\">{s.detail}</span> : null}\n            </button>\n          ) : layout === 'list' ? (\n            <button type=\"button\" onClick={() => pick(s)}\n              className=\"flex w-full items-center gap-2.5 border-t border-border px-1 py-2.5 text-left text-sm hover:bg-card outline-hidden focus-visible:ring-3 focus-visible:ring-ring/50\">\n              {s.label}\n              <Icon name=\"arrow_forward\" className=\"size-icon-md ml-auto text-muted-foreground\" />\n            </button>\n          ) : (\n            <button type=\"button\" onClick={() => pick(s)}\n              className=\"inline-flex h-8 items-center rounded-full border border-border bg-background px-3 text-sm text-ink-soft hover:bg-muted hover:text-foreground outline-hidden focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\">\n              {s.label}\n            </button>\n          )}\n        </li>\n      ))}\n    </ul>\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/ui/suggested-prompts.tsx"
    }
  ],
  "docs": "Ready-made things to ask an AI — chips for follow-ups under an answer, cards for starters on an empty page, a list in a narrow panel. Picking one fills the composer; it never sends. Do: Fill the composer and focus it, so people can edit before sending. Don't: Send the suggestion the moment it is clicked — people lose the chance to adjust it. Do: Use chips under an answer, cards on an empty AI page, and the list in a narrow panel. Don't: Put large starter cards under every answer — they crowd the thread. Use command when people pick from a long, searchable list of actions. Use button when the choice runs an action straight away instead of filling the composer.",
  "type": "registry:ui"
}