Skip to content
pandacoderz/ui

Suggestions

Prompt suggestion chips and a dismissible suggestions panel.

Pick a suggestion

Installation

npx shadcn@latest add https://ui.spencerwueste.com/r/suggestions.json

Usage

import {
  Suggestion,
  SuggestionList,
  Suggestions,
} from "@/components/pandacoderz-ui/suggestions";
<Suggestions onSelect={(text) => send(text)}>
  <SuggestionList>
    <Suggestion>Summarize this document</Suggestion>
    <Suggestion highlight="email">Draft a launch email</Suggestion>
  </SuggestionList>
</Suggestions>

Use SuggestionPanel for a panel that sits above the prompt input and can be dismissed with Escape or its close button.

API Reference

Suggestions

Prop Type Description
onSelect (value: string) => void Called with the suggestion’s value or text.

Suggestion

Prop Type Description
variant "filled" | "outline" | "ghost" Visual style. Default filled.
value string Value passed to onSelect. Defaults to the text content.
highlight string | string[] Terms to render de-emphasized inside the label.

SuggestionPanel

Prop Type Description
open boolean Controlled open state.
onOpenChange (open: boolean) => void Called on close requests.
onClose () => void Called after the exit animation finishes.