Skip to content
caliper ui pro docs

Approvals

Cards that ask the user to allow or deny an action, with a risk label.

Pro

Delete 3 stale snapshot files

High risk

These files are no longer referenced by any test. Deleting them cannot be undone from here.

  • tests/__snapshots__/table.old.snap
  • tests/__snapshots__/tree.old.snap
  • tests/__snapshots__/thread.old.snap

Approval needed: Delete 3 stale snapshot files

When to use

  • An agent wants to run a tool that changes something.
  • The decision should be explicit and reversible where possible.

When not to use

  • The action is harmless and routine; do not interrupt.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/approvals

Adds its 6 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.

API reference

ApprovalCard

12 props
PropTypeDefaultDescription
title *string—
descriptionReactNode—
riskApprovalRisk"medium"
detailsReactNode—What exactly will happen: a diff, a command, a list of changes.
status *ApprovalStatus—
onApprove *() => void—
onDeny *() => void—
approveLabelstring"Approve"
denyLabelstring"Deny"
resolvedBystring—
resolvedAtstring—
classNamestring—

ToolApproval

10 props
PropTypeDefaultDescription
name *string—
summarystring—One sentence in plain language: "Read three files in src/".
argsRecord<string, unknown>—
scopesreadonly string[]—Permissions this call needs, in plain words.
status *ToolStatus—
resultReactNode—
durationstring—For example "1.2 s".
onDecision((decision: ToolDecision) => void)—
errorTextstring—
classNamestring—

RiskChip

1 prop
PropTypeDefault
risk *ApprovalRisk—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes status and alert semantics, with aria-hidden, aria-label and aria-expanded kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/approvals.md

The index of every part is at /llms.txt.

More in Agent work