Skip to content
caliper ui pro docs

Card vault

A virtual card screen. The number lives on the back: the card flips only after a passcode and turns itself back over after 15 seconds. Freezing tilts the card back and frosts it. The details are not on the page at all until they are revealed.

Pro

Team travel card

Mira Solheim’s virtual card for the Porto offsite

VIRTUAL · TEAM
4821
Mira Solheim

Card details

The number, expiry and CVC stay hidden until you confirm it is you.

Spend this month$1,240 of $2,000
  • Halden Rail$38.50
  • Notion$16
  • Fly Air Porto · return flights$184.20
  • Cafe Lumen$6.40

When to use

  • Showing a payment card's number, expiry and CVC behind a step-up.
  • Any sensitive reveal that should be visible as a state, not a hidden toggle.

When not to use

  • Storing or passing card data around the page. Fetch it in onReveal and let the part drop it.
  • Secrets that are not shown on a card; use the secret field.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/card-vault

Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

CardVault

15 props
PropTypeDefaultDescription
card *CardVaultCard—
limitCardVaultLimit—
transactionsreadonly CardVaultTransaction[][]
onReveal *(passcode: string) => CardVaultDetails | Promise<CardVaultDetails | null> | null—The step-up. Receives what the person typed; return the details when it is right and null when it is not. May be async.
onFreeze((frozen: boolean) => void)—Asked for the new state; set `card.frozen` to apply it.
onCopy(() => void)—Called after the number is copied. It receives nothing, so the number never leaves the part by this route.
revealSecondsnumber15How long the details stay showing.
passcodeLengthnumber4
passcodeHintReactNode—Shown beside the passcode label, for example a hint in a demo.
format((amount: number) => string)moneyHow money is written. Defaults to US dollars.
statusDepthStatus"ready"
messagesDepthMessages—
onRetry(() => void)—
disabledboolean—
classNamestring—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes group, alert, timer and meter semantics, with aria-label, aria-hidden, aria-invalid, aria-describedby, aria-valuemin and aria-valuemax kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/card-vault.md

The index of every part is at /llms.txt.

More in Commerce