Prompt library preview
Browse reusable prompts, fill in their variables and select a finished prompt.
pro · Blocks · composite
When to use
- Use it when a page needs browse reusable prompts, fill in their variables and select a finished prompt.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.
Alternatives
- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than prompt library.
Configure components.json and the @tidal-pro namespace before installing Pro components.
Installation
npx shadcn@latest add @tidal-pro/prompt-libraryImport components/ui/tidal.css, components/ui/prompt-library.css. Wrap installed components in tidal-scope.
Preview

Minimal example
import"./components/ui/tidal.css";
import"./components/ui/prompt-library.css";
import{TidalPromptLibrary}from"./components/ui/prompt-library";
export default(p:Parameters<typeof TidalPromptLibrary>[0])=><div className="tidal-scope"><TidalPromptLibrary {...p}/></div>;API and props
TidalPromptLibrary.categories (required)ReadonlyArray<TidalPromptCategory>Required categories value accepted by this exported component.
TidalPromptLibrary.categoryId (required)stringRequired category id value accepted by this exported component.
TidalPromptLibrary.favorites (required)ReadonlyArray<string>Required favorites value accepted by this exported component.
TidalPromptLibrary.favoritesOnly (required)booleanRequired favorites only value accepted by this exported component.
TidalPromptLibrary.onCategoryChange (required)(id: string) => voidCallback invoked when the category change interaction is proposed.
TidalPromptLibrary.onFavoriteChange (required)(id: string, saved: boolean) => voidCallback invoked when the favorite change interaction is proposed.
TidalPromptLibrary.onFavoritesOnlyChange (required)(only: boolean) => voidCallback invoked when the favorites only change interaction is proposed.
TidalPromptLibrary.onQueryChange (required)(value: string) => voidCallback invoked when the query change interaction is proposed.
TidalPromptLibrary.onSelectedChange (required)(id: string) => voidCallback invoked when the selected change interaction is proposed.
TidalPromptLibrary.onUse (required)(prompt: TidalPromptRecord, rendered: string, event: MouseEvent<HTMLButtonElement>) => voidCallback invoked when the use interaction is proposed.
TidalPromptLibrary.onVariableChange (required)(id: string, value: string) => voidCallback invoked when the variable change interaction is proposed.
TidalPromptLibrary.prompts (required)ReadonlyArray<TidalPromptRecord>Required prompts value accepted by this exported component.
TidalPromptLibrary.query (required)stringRequired query value accepted by this exported component.
TidalPromptLibrary.selectedId (required)string | nullRequired selected id value accepted by this exported component.
TidalPromptLibrary.title (required)ReactNodeRequired title value accepted by this exported component.
TidalPromptLibrary.values (required)Readonly<Record<string, string>>Required values value accepted by this exported component.
TidalPromptLibrary.actionPropsActionProps | undefinedOptional action props value accepted by this exported component.
TidalPromptLibrary.descriptionReactNodeOptional description value accepted by this exported component.
TidalPromptLibrary.disabledboolean | undefinedOptional disabled value accepted by this exported component.
TidalPromptLibrary.favoriteProps((prompt: TidalPromptRecord) => ActionProps) | undefinedOptional favorite props value accepted by this exported component.
TidalPromptLibrary.formatCount((count: number) => ReactNodeLike) | undefinedOptional format count value accepted by this exported component.
TidalPromptLibrary.headingLevel"h2" | "h3" | "h4" | "h5" | undefinedOptional heading level value accepted by this exported component.
TidalPromptLibrary.labelsPartial<{ search: string; category: string; all: string; saved: string; save: string; remove: string; empty: string; choose: string; preview: string; variables: string; use: string; required: string; invalid: string; }> | undefinedOptional labels value accepted by this exported component.
TidalPromptLibrary.selectProps((prompt: TidalPromptRecord) => ActionProps) | undefinedOptional select props value accepted by this exported component.
Complete usage
Full example, stylesheet imports, API and accessibility documentation
Gotchas
- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.