Approval
A human approval prompt with optional expiry.
Install
npx shadcn@latest add https://crate.onerollstudios.com/r/approval.jsonPlayground
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
| Prop | Type | Required | Default | Notes |
|---|---|---|---|---|
className | string | no | ||
accent | boolean | no | false | |
labels | Partial<CrateLabels> | no | Replace any of this component's labels. Overrides CrateProvider. | |
title | string | no | ||
preview | ReactNode | no | ||
onAllow | (() => void) | no | ||
onDeny | (() => void) | no | ||
expiresIn | number | no |
Labels
Override with the labels prop or a CrateProvider.
| Label | English 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.