OfferLifetime Pro for $99

Prompt Library

Templates with search, category chips, favourites and Recently used. Open one and its blanks become inputs inside the sentence: text, numbers, an inline choice or a long note. The finished prompt assembles underneath, and Use prompt counts what is missing. New and Edit list the variables they found as you type.

The decision inside it

A blank remembers, and a repeated blank is one field

Fill {customer} once and every copy updates. Open the template tomorrow and it is already filled from last time, with a Clear. The values stay with your app: they come in through remembered and go out through onRemember.

When to use it

Use Prompt Library for saved prompt templates with blanks ({customer}, {tone: friendly|firm}, {notes:long}) that people fill inside the sentence. Values come back through remembered and onRemember, so storage stays in your app.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Prompt Library for this.
Install it: npx shadcn@latest add @layro/prompt-library
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/prompt-library.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.

Usage

components/prompts.tsx
import { PromptLibrary, type PromptTemplate, type PromptValues } from "@/components/ui/prompt-library";

const templates: PromptTemplate[] = [
  { id: "follow-up", title: "Follow up on a contract", category: "Sales", body: "Write a {tone: friendly|firm} follow-up to {customer} about {contract}." },
];

export function Prompts({ saved, store, insert }: {
  saved: Record<string, PromptValues>;
  store: (id: string, values: PromptValues) => void;
  insert: (text: string) => void;
}) {
  return <PromptLibrary templates={templates} remembered={saved} onRemember={store} onUse={(text) => insert(text)} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
templatesrequiredPromptTemplate[]—
rememberedRecord<string, PromptValues>Last values per template id.
onRemember(id: string, values: PromptValues) => voidCalled when a prompt is used, with what to remember for next time.
onUse(text: string, values: PromptValues, template: PromptTemplate) => void | Promise<void>May return a promise.
onSave(template: PromptTemplate) => void | Promise<void>New or edited template. May return a promise. Leave out to hide New and Edit.
onToggleFavourite(id: string, favourite: boolean) => void—
selectedIdstringThe open template. Leave out to let the library keep its own.
defaultSelectedIdstring—
onSelectedChange(id: string) => void—

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themebadgebutton

States

All of them are drawn by the component. None is left for you to design.

  • List
  • Filling
  • Filled from last time
  • Missing blanks
  • Used
  • Editing
  • Use failed

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances

Used in a screenAll screens

Lifetime access

Every component, and everything we ship next.

  • All 232 components, source included
  • Every template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.