Skip to content
Twentyfirst UIPro

Money Preview

AI · MoneyPreview, ApprovalCard

View as Markdown

Money that moves: the amount large and with cents, the currency (EUR by default, formatted in the provider's locale), the recipient masked, account and reference, the bookings it writes with their sum, or the payment a refund goes back to. Shows "Needs a fresh passkey" unless stepUp={false}; pair it with ApprovalCard stepUp.

Approval neededLedger · BillingMoney38 min

Refund €10.00 to the card ending 4242

The customer was charged twice for order 2041.

Amount€10.00
Recipient
Visa …4242
Reference
Order 2041
Refund of
pay_3PqL8x2k€10.00 · Apr 14, 18:02

Needs a fresh passkey

Escalates to the owner in 1:22 h
Approval neededLedger · FinanceMoney2 h

Book 3 receipts from March

Props

MoneyPreview

PropTypeNotes
title?ReactNode
amountnumberIn the currency's units (12.5 = €12.50); negative for money going out of a booking.
currency?stringISO code (default EUR).
recipient?stringAlready masked ("DE89 …3000", "…4242").
reference?ReactNode
account?ReactNode
bookings?MoneyBooking[]The bookings this writes, with their sum below.
refund?{ payment: ReactNode; paidAt?: ReactNode; original?: number }A refund: the payment it goes back to.
stepUp?booleanShows "Needs a fresh passkey" (default true).
facts?KeyValueItem[]
warnings?ReactNode[]
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

ApprovalCard

PropTypeNotes
titleReactNodeRequired
text?ReactNode
children?ReactNode
agent?string
project?string
family?RiskFamily
familyLabel?string
age?string
escalation?ReactNode
trace?ReactNode
note?ReactNode
heading?string
options?ApprovalOption[]
approveLabel?string
onDecide?(key: ApprovalKey, text?: string) => void | Promise<unknown>Called with the answer (and the text of B or D). Return a Promise to keep the card busy until it settles: the answer's button spins and every answer is disabled; a rejection shows an error (a rejected string is shown as is) and keeps the card open. Once it resolves, a card without a `decision` prop collapses to its one-line record; with a plain callback, set `decision` yourself.
decision?ApprovalDecision | nullThe decision record: shown as one line instead of the card; `null` keeps the card open.
compact?booleanSide panels: tighter, the answers in a row, the payload folded behind "Show what runs" (one click, never a summary).
stepUp?booleanMoney, legal and infrastructure decisions: A and B (the answers that run something) need a fresh passkey. They show "Needs your passkey"; while `onDecide` is pending the pressed answer says "Confirm with passkey". Do the WebAuthn step-up in `onDecide` and reject if it fails.
busy?ApprovalKey | nullThe answer being sent, when you track it yourself (controlled busy state).
error?ReactNodeAn error to show above the answers (controlled); a rejected `onDecide` shows one by itself.
screen?booleanFills its container, e.g. a deep link on a phone: the content scrolls and A–D stay at the bottom, full width, in thumb reach (with the safe area).
href?stringMakes the title a link to the full approval (with `linkAs` for a router's link).
linkAs?ElementType
onApprove?() => void
onDeny?() => void
onEdit?(text: string) => void
state?"approved" | "denied"
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.