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#
| Prop | Type | Default |
|---|---|---|
prompts | Prompt[] | SAMPLE_PROMPTS |
onSelect | (p: Prompt) => void | - |
className | string | - |
Dependencies#
npm
React only
Built from
Examples#
Related ai chat components#
Agent TraceReact timeline of an AI agent run: each tool step shows pending, running, done or error, reports its duration and folds out details. The header sums up the run.Ai ComposerChat input for AI apps with a multiline textarea, Enter to send, suggestion chips, attach button, model picker and a stop button while a response streams.Artifact PreviewFramed preview for AI generated artifacts such as code, documents or UI, with a title bar, copy button and optional expand action for a full view.Attachment ChipCompact Tailwind file chip with a paperclip icon, truncated filename and an optional remove button, for attachments in chat composers, emails and forms.Chat ThreadScrolling chat thread for React that renders user, assistant and system messages as bubbles, auto scrolls to the newest one and uses a live log role.Citation ChipInline citation button for AI answers, with an accent source number and label. Link it to a source panel or popover so users can check references.
All AI chat UI components for React