Xzero UI
Pro library

Payment flowPro

A card tap goes to a processor, then the network, then the bank and back with authorization, then settlement; each hop lights up with a status label and the amount travels as a chip.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/payment-flow
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/payment-flow

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { PaymentFlow } from "@/components/xzero/payment-flow/payment-flow";

export function PaymentsSection() {
  return <PaymentFlow
    amount={42.5}
    fee={1.53}
    balance={1284.1}
    currency="USD"
    caption="Approved in about a second, paid out the next business day."
  />;
}

API reference

PaymentFlow

An animated card payment illustration. A tap at checkout sends the amount as a small chip through the processor and the card network to the issuing bank, slipping under each node while it is processed as that node's status line changes. The bank approves, and an approval chip travels back and repaints the path in success. Then settlement runs on a second rail: the funds clear through the network, the processor takes its fee (the chip turns into the net amount), and the payout lands in the merchant balance, which counts up. A step row under the diagram counts the authorization time and fills as settlement runs.

PropTypeDefaultDescription
nodes{ terminal?, processor?, network?, issuer?, merchant?: PaymentFlowNode }Checkout, Stripe, Mastercard, Bank, Your balanceThe five stops. Each one you pass replaces the default for that stop. A node is { label, meta?, detail?, icon?, color? }: meta is the resting second line, detail is the hover tag, icon is SVG path data on a 24 by 24 viewBox painted in color, an image URL, or any ReactNode. The merchant's second line always shows the balance.
amountnumber42.5The charge, shown on the chip that travels to the bank.
feenumber1.53What the processor keeps at settlement. The payout is amount minus fee.
balancenumber1284.1Merchant balance before the first payout. It grows by the payout on every loop.
currencystring"USD"ISO currency code for every amount.
localestring"en-US"Locale for money formatting. Keep it fixed so the server and the browser agree.
authorizationMsnumber1340Authorization time the step row counts to, in milliseconds.
labels{ authorization?: string; settlement?: string; settlementTime?: string; approved?: string }Authorization, Settlement, Next business day, ApprovedPhase names in the step row, when settlement happens, and the text on the approval chip.
hideStepsbooleanfalseHides the step row and shows only the diagram.
speednumber1Multiplies the pace. At 1 one payment takes about 15 seconds. 0 holds still.
pausedbooleanfalseHolds the diagram still where it is, easing to rest instead of stopping in one frame.
accentstring–Color of the moving amount, the active path, the settlement rail, and hovered wires. Defaults to the accent token. Approval and settled states stay semantic success.
labelstring–Accessible description of the diagram. Built from the nodes and amounts when left out.
captionReactNode–Optional visible caption under the diagram, rendered as a figcaption.
classNamestring–Extra class on the root figure.
styleCSSProperties–Inline styles on the root figure.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in illustrations

Guidance for AI tools

Payment flow: A card tap goes to a processor, then the network, then the bank and back with authorization, then settlement; each hop lights up with a status label and the amount travels as a chip. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components