Prompt Library
Prompt library with variables. Pro · AI chat and agents › Prompts and models
Saved prompts with search, categories and favourites. Picking one generates a form for its {{variables}}, previews the filled prompt and inserts it into your composer.
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add prompt-library
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { PromptLibrary } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
prompts * | SavedPrompt[] | Saved prompts to browse, search and insert; {{variables}} in a template become fields to fill in. | |
categories | string[] | Category filter order. Defaults to the categories of prompts, in order of appearance. | |
favorites | string[] | Ids of starred prompts. | |
defaultFavorites | string[] | [] | Initial favorites when uncontrolled. |
onFavoritesChange | (ids: string[]) => void | Called with the new favorites when it changes. | |
selected | string | null | Id of the open prompt. | |
defaultSelected | string | null | null | Initial selected when uncontrolled. |
onSelectedChange | (id: string | null) => void | Called with the new selected when it changes. | |
onInsert * | (text: string, prompt: SavedPrompt) => void | Called with the filled-in prompt text. | |
labels | Partial<PromptLibraryLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Prompt Composer — Prompt field with attachments
- Inline Suggestion — Inline autocomplete suggestion
- Model Selector — AI model picker
- Model Comparison — Side-by-side answers from several models
- AI Chat Window — AI chat window
- Chat Message — Messages with streaming output
- Message Branches — Message versions and a conversation branch tree
- Streaming Text — Smooth token streaming
- Markdown Preview — Rendered Markdown
- Response Feedback — Answer rating and a rubric for reviewers
- Chain of Thought — Model reasoning steps
- Tool Call — Tool call with approval
Previous: Model Comparison · Next: Chain of Thought · All AI chat and agents