Approval Card

Pauses an agent to get a decision from a person: walk them through single-choice, multi-choice or write-in questions step by step, or ask them to approve, request changes or reject, then shrink to a record of what they chose.

Questions

index.tsx

Steps through single-select, multi-select and write-in questions one at a time, then hands the full set of answers back to the agent.

Approval Card Questions preview width

Review and Approve

index.tsx

Halts a run so a person can approve, ask for changes or reject, then folds down to show the decision that was made.

Approval Card Review and Approve preview width

API Reference

title?
ReactNode
Approval required
description?
ReactNode
—
questions?
ApprovalCardQuestion[]
[]
status?
"pending" | "submitting" | "approved" | "rejected" | "changes-requested" | "answered"
pending
answers?
ApprovalCardAnswers
—
defaultAnswers?
ApprovalCardAnswers
{}
onAnswersChange?
((answers: ApprovalCardAnswers) => void)
—
step?
number
—
defaultStep?
number
0
onStepChange?
((step: number) => void)
—
onSubmit?
((answers: ApprovalCardAnswers) => void)
—
onApprove?
(() => void)
—
onReject?
(() => void)
—
onRequestChanges?
(() => void)
—
onDismiss?
(() => void)
—
approveLabel?
ReactNode
Approve
submitLabel?
ReactNode
Submit response
result?
ReactNode
—
className?
string
—

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/approval-card
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

Composition

Render the card in the message where the agent stopped to wait.

Message
└── MessageContent
    └── ApprovalCard

Note: Tool Approval covers the simpler yes or no on a single tool. Message keeps the decision in the transcript next to its turn. Todo List shows which planned steps are waiting on the answer.

How it works

Asking a person mid-run hands control back to them for a moment. Say plainly what needs deciding, ask only for what the agent needs, and give the paused run an answer it can rely on.

Updated