Prompt Library

A searchable list of saved prompts that filters by title, body and tag as you type and returns the chosen prompt through onSelect. Useful in React AI apps.

src/registry/ui/prompt-library.tsx/r/prompt-library.json

Installation#

bash
npx shadcn@latest add @minidev/prompt-library

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/prompt-library.json

Usage#

tsx
import { PromptLibrary } from "@/components/ui/prompt-library"

export function Example() {
  return (
    <PromptLibrary
      prompts={[
        { id: "1", title: "Critique UI", body: "Review this screen for Hairline violations.", tag: "Design" },
        { id: "2", title: "Write changelog", body: "Summarize commits as a customer-facing changelog.", tag: "Docs" },
      ]}
    />
  )
}

API reference#

PromptLibrary props
PropTypeDefault
promptsPrompt[]SAMPLE_PROMPTS
onSelect(p: Prompt) => void-
classNamestring-

Dependencies#

npm

React only

Built from

Examples#

All AI chat UI components for React