Skip to content
Calm motion: animations on this site only fade, with no movement

Prompt library ​

Saved prompts with a search, tags, and fill-in fields

Keeps the prompts that a person or a team uses often, so they do not type them again.

Basic

Pick a prompt on the left.

  • prompts is the list. Each prompt has an id, a title, a text, and optional tags.
  • Write a field in the text as . When a person picks the prompt, each field gets a text box, and the preview fills in as they type. An empty field keeps its .
  • The search looks in the titles, the texts, and the tags. The tag buttons show one tag at a time.
  • "Use this prompt" emits use with the filled text and the prompt. Put the text in your prompt input.
  • On a narrow screen, the detail goes below the list.
  • Change the words with labels or a label pack. The API table lists the keys.

The promptFields and fillPrompt functions do the work on the fields. They are exported for your own views.

Usage ​

ts
import { BlessPromptLibrary } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
prompts*BlessSavedPrompt[]—
labelsPartial<{ search: string; all: string; tags: string; list: string; none: string; preview: string; use: string; pick: string; }>—

Events

NamePayloadDescription
use[text: string, prompt: BlessSavedPrompt]

Released under the MIT License. Character names and artwork belong to their owners.