Prompt playground
ProWork on a prompt with real inputs: a field for every {{variable}}, model and sampling settings beside it, output with tokens and time, and saved versions you can diff against the editor, settings included.
pnpm dlx shadcn@latest add @caliper/prompt-playgroundPromptv3
Saved by Maya Chen, 9 Oct
Write {{name}} for a variable. ⌘ Enter runs.
Run the prompt to see what the model writes.
When to use #
Use it for
- Prompt management and LLM developer tools.
- Internal tools where teams tune prompts together.
Skip it when
- End users chatting with an assistant; use the chat shell.
Installation #
pnpm dlx shadcn@latest add @caliper/prompt-playground
Adds its 16 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source. It is built from templateVariables, fillTemplate and PromptPlayground.
import { templateVariables, fillTemplate, PromptPlayground } from "@/components/ui/prompt-playground"
The worked example comes with Pro
The 41-line example behind the preview opens here with a Pro or Team licence.
API reference #
templateVariables
component
No props of its own; it accepts the native props of its root element.
fillTemplate
component
No props of its own; it accepts the native props of its root element.
PromptPlayground
component
Accessibility #
It exposes status and alert semantics, with aria-labelledby, aria-label, aria-hidden, aria-keyshortcuts, aria-describedby and aria-invalid kept in step with state. Changes that matter are announced through a live region.
Motion #
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.