Docs / Approval

Approval

A human approval prompt with optional expiry.

Install

npx shadcn@latest add https://crate.onerollstudios.com/r/approval.json

Playground

Send this email?

Expires in 30s

The agent wants to reply to the thread with a summary.

Sample data for preview.

Callbacks (onAllow, onDeny) are logged here when the component calls them.

<Approval
  title="Send this email?"
  expiresIn={30}
  preview={preview}
  onAllow={() => {}}
  onDeny={() => {}}
/>

Import

import { Approval } from "@/components/agent-wait-states/approval";

Props

PropTypeRequiredDefaultNotes
classNamestringno
accentbooleannofalse
labelsPartial<CrateLabels>noReplace any of this component's labels. Overrides CrateProvider.
titlestringno
previewReactNodeno
onAllow(() => void)no
onDeny(() => void)no
expiresInnumberno

Labels

Override with the labels prop or a CrateProvider.

LabelEnglish default
approvalRequired"Approval required"
approvalTitle"The agent wants to send this email"
expiresIn(seconds, f) => `Expires in ${f.seconds(seconds)}`
approvalPreview"Review this action before it runs."
deny"Deny"
allow"Allow"

Example

<Approval preview={action} onAllow={allow} onDeny={deny} expiresIn={30} accent />

For coding agents: /llms/approval.md, generated from the same source.