ApprovalCard

Markdown

A review card for approving or rejecting a proposed action.

Used in Action receipts and Agent Workbench.

Use it for
Approving or rejecting one proposed agent action, bound to its version.
Not for
Generic confirmations unrelated to an agent. Try AlertDialog or ApprovalBatch.

ApprovalCard preview

Review required

Archive 3 inactive accounts

Pending

CRM sandbox · Demo workspace · accounts:archive · Medium risk

3 accounts become read-only. An administrator can restore them.

Installation

npm install @stackunseen/ui
import { ApprovalCard } from '@stackunseen/ui';
Styles: @stackunseen/ui/styles.css

Parts

A card for one proposed action. It shows what your server sent, asks for a decision and never claims the action ran.

  1. Header

    A risk icon, what kind of decision it is ("Review required"), the action and its status.

    Built fromStatusBadge

    Propsproposal

  2. Summary

    What your server supplied about the action, such as its scopes, then its impact in plain words.

    Propsproposal

  3. Details

    Hidden until someone presses Details: risk and version, expiry, scopes when none were given, and a note that permission is checked again before anything runs.

    Propsproposal

  4. Warnings

    Shown only when needed: the proposal changed, it expired, or your server reported an error.

    Propsstale expired error

  5. Decision

    Details, Reject and Approve action, then a status line that says "Decision received" only once your server confirms. If the outcome is unknown, Check decision status replaces the buttons.

    Built fromButton

    PropsonDecision submission onReconcile

Usage and props

Show an action for review before sending a decision to your server. Send the proposal’s version and digest with it, and track whether the action ran separately from whether the decision was received. On your server: check who is asking, recheck the scope, version and expiry, ignore duplicates, then run the action.

proposalApprovalProposal
The action details, scope, version, digest, status and expiry from your server.
submissionSubmissionState
The decision request state. Keep it separate from proposal.status.
onDecision(decision: 'approve' | 'reject', proposal: ApprovalProposal) => void
Send the chosen decision for this proposal and update submission from the result.
staleboolean (optional)
Disables decisions when the displayed proposal may be out of date.
errorstring (optional)
The decision failure to show. The card does not infer a result from a click.
onReconcile() => void (optional)
Look up the original decision after an unknown outcome before trying again.
How state and callbacks work
All props

Loading…

For your coding agent

Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.

Contract
proposal · submission · stale? · expired? · onDecision · onReconcile?
Keeps honest
On your server: check who is asking, recheck the scope, version and expiry, ignore duplicates, then run the action.
MCP
read_component "ApprovalCard" on the docs endpoint
Open the Markdown file

Keyboard and customization

Keyboard

Tab reaches Reject, then Approve action. When the outcome is unknown, it reaches Check decision status instead. Enter or Space activates an enabled action.

Customization

Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio