# Prompt Editor block

> Prompt Editor with Configuration and Evaluation Details

Full-page prompt editor with tabbed sections for overview, text, safety, evaluations, and access. Status badges, form fields, timeline, save-discard workflow. ReUI Badge; shadcn Button, Tabs. For AI ops dashboards and model operator portals.

- Type: Pro block
- Category: [AI Ops](https://web.dev.reui.io/blocks/solutions/ai-ops.md)
- Page: https://web.dev.reui.io/blocks/solutions/ai-ops/solution-ai-ops-4
- MCP: `get_block("solution-ai-ops-4")`
- Built with: Alert, Avatar, Badge, Button, Card, Checkbox, Collapsible, Combobox, Field, Input, Input Group, Item, Select, Separator, Spinner, Switch, Tabs, Textarea, Timeline, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

One prompt edited across 5 tabs, from system text and user template to reviewers, eval runs and access, with an Unsaved or Saved badge

## Agent notes

- Sample prompt data lives in `PROMPT_RECORD`, `PROMPT_SYSTEM_TEXT`, `PROMPT_USER_TEMPLATE` and `evaluationSteps`
- Most fields are uncontrolled `defaultValue` inputs that only call `onDirtyChange`, so collect the form values yourself before saving
- `handleSave` persists nothing, `handleDiscard` resets only `promptStatus`, Run Eval only toasts, and `dirty` starts true so the badge opens on Unsaved

## When not to use

- A member profile an admin edits, with an audit rail and an activity heatmap: use [Member Profile Admin](https://web.dev.reui.io/blocks/application/form/form-5.md) (`get_block("form-5")`)
- An agent run detail with an inline step trace: use [Run Step Trace](https://web.dev.reui.io/blocks/solutions/agents/solution-agents-3.md) (`get_block("solution-agents-3")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)
- Base UI v1: [API reference](https://base-ui.com/react/components), [docs](https://base-ui.com/react/overview/quick-start), [llms.txt](https://base-ui.com/llms.txt)

## Install

```bash
npx shadcn@latest add @reui/solution-ai-ops-4
```

## About AI Ops blocks

### When to use

- Model operations dashboards that track provider health, token volume and spend against a budget cap
- Provider connection and routing pages that set priority order, fallback providers and risk tier controls
- Prompt, feature flag and token usage registries, a prompt editor and a safety policy wizard

### When not to use

- Autonomous agent runs, tool permissions and human approval of agent actions: use the [Agents blocks](https://web.dev.reui.io/blocks/solutions/agents.md)
- A bare table for your own columns and rows, with no provider or token sample records: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)
- A KPI tile and trend chart overview for a fulfillment, staffing, revenue or payouts team: use the [Dashboard blocks](https://web.dev.reui.io/blocks/application/dashboard.md)

### Agent notes

- Each page.tsx wraps the block in a `min-h-svh` container; remove it when the block sits inside your app shell
- No block calls an API: changes stay in local `useState` or uncontrolled inputs, so wire each save, switch, export and row action to your backend

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
