Agentic control
Action receipt
Use when the agent has just changed something real and people need proof of what changed, plus a short window to undo it.
Evidence of what changed, under whose authority, with a time-limited undo.
Part of Agentic control. The stage where the agent stops answering and starts doing. It covers the whole handover: agreeing what the agent may do, watching it work, stepping in, and checking what changed afterwards. Reach for these as soon as an action touches a customer, money or a record.
Do
- State what changed, where, and under which rule the agent was allowed to do it.
- Show the value before and after, with the difference.
- Count the undo window down, and link to the audit log once it closes.
Don't
- Don't ask for confirmation first when the action can be reversed. Act, then offer undo.
- Don't remove the receipt when the window closes. It becomes the record.
- Don't offer undo for something that cannot be reversed.
States
- Undo window open: A pulsing green dot, the what, where and authority rows, the before and after strip, and an Undo button with a countdown ring.
- Window closed: The Undo button is replaced by a link to the audit log and a caption saying the window has closed.
- Reversed: The title, timestamp and rows switch to the reversal, the strip runs backwards, and the caption confirms nothing else was affected.
Usage
import { ActionReceiptPattern } from "./halaska-kit";
<ActionReceiptPattern
title="Credit issued"
timestamp="14:32:07 UTC"
meta={[
{ label: "What", value: "Issued a $180 credit to Acme" },
{ label: "Where", value: "Stripe · Acme" },
{ label: "Authority", value: "Within your $500 refund cap" },
]}
before={0}
after={180}
unit="USD"
onUndo={() => reverseCredit()}
onAudit={() => openAuditLog()}
/>
ActionReceiptPattern props
titlestring(default "Credit issued"): Headline while the action stands (default: "Credit issued")reversedTitlestring(default "Reversed"): Headline after undo (default: "Reversed")timestampstring(default "14:32:07 UTC"): Mono timestamp shown top-right (default: "14:32:07 UTC")reversedTimestampstring(default "14:32:19 UTC"): Timestamp shown after undo (default: "14:32:19 UTC")meta{ label: string, value: string }[](default RECEIPT_META): What / Where / Authority rows (default: RECEIPT_META)reversedMeta{ label: string, value: string }[](default RECEIPT_META_REVERSED): Rows shown after undo (default: RECEIPT_META_REVERSED)beforenumber(default 0): Credit balance before the action (default: 0)afternumber(default 180): Credit balance after the action; counts up on mount (default: 180)unitstring(default "USD"): Unit suffix on the strip and delta (default: "USD")decimalsnumber(default 0): Decimal places for before/after/delta (default: 0)stripLabelstring(default "Acme credit"): Label at the left of the before → after strip (default: "Acme credit")undoSecondsnumber(default RECEIPT_UNDO_SECONDS): Length of the undo window; drives the ring and countdown (default: 10)undoLabelstring(default "Undo"): Undo button text (default: "Undo")expiredLabelstring(default "Undo window closed"): Caption once the window closes (default: "Undo window closed")reversedLabelstring(default "Reversal logged · nothing else was affected"): Caption after undo (default: "Reversal logged · nothing else was affected")auditLabelstring(default "View in audit log"): Audit link text in the expired and reversed states (default: "View in audit log")autoplayboolean(default true): Run the countdown + count-up on mount; false renders the expired state with no timers (default: true)onUndo() => void: Fires when the user clicks Undo inside the windowonExpire() => void: Fires when the undo window closes untouchedonAudit() => void: Fires when the user clicks the audit link
Built from
Card, Label, Separator, Stack, Typography
Related patterns
Halaska UI · Components · Patterns · Screens · Install