ApprovalCard
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
Archive 3 inactive accounts
CRM sandbox · Demo workspace · accounts:archive · Medium risk
3 accounts become read-only. An administrator can restore them.
- Risk / version
- Medium · v1
- Expires
- Execution
- Permission and the latest proposal are checked again before anything runs.
Installation
npm install @stackunseen/uiimport { ApprovalCard } from '@stackunseen/ui';@stackunseen/ui/styles.cssParts
A card for one proposed action. It shows what your server sent, asks for a decision and never claims the action ran.
Header
A risk icon, what kind of decision it is ("Review required"), the action and its status.
Summary
What your server supplied about the action, such as its scopes, then its impact in plain words.
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.
Warnings
Shown only when needed: the proposal changed, it expired, or your server reported an error.
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.
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.
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
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