Pro
Payment methods
The cards on an account and a form to add one: brand detected as you type, the number checked before sending, expiry warnings, a bank confirmation step, and a default that cannot be removed by accident.
pnpm dlx shadcn@latest add @caliper/payment-methodsPayment methods
- Visa ending 4242Expires 08/28Default
- Mastercard ending 4444Expires 11/26 · update it before then
Test numbers: 4242 4242 4242 4242 adds; 4000 0000 0000 3220 asks the bank; 4000 0025 0000 3155 is declined.
When to use
Use it for
- Billing settings.
- Any account that keeps a card on file.
Skip it when
- A one-off checkout; use the checkout form.
Installation
pnpm dlx shadcn@latest add @caliper/payment-methods
Adds its 10 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.
Usage
Import it from your copy of the source. The example behind the preview comes with the source. It is built from cardBrand, luhn and PaymentMethods.
import { cardBrand, luhn, PaymentMethods } from "@/components/ui/payment-methods"
The worked example comes with Pro
The 42-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
cardBrand
component
No props of its own; it accepts the native props of its root element.
luhn
component
No props of its own; it accepts the native props of its root element.
PaymentMethods
component
Accessibility
It exposes group, alert and status semantics, with aria-hidden, aria-labelledby, aria-label and aria-disabled kept in step with state. Changes that matter are announced through a live region.
Keyboard and focus handling comes from Radix popover: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.
Motion
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.
Related
- Billing screenPlan, usage and money: the next invoice itemised before it is charged, usage with its cost at this pace, and failed invoices with a pay action.
- Finance homeWhere finance starts the day: cash across every entity and currency in one reporting total, lines to match, claims to approve and invoices past due, and each entity's progress through the close.
- Finance reconcileBank reconciliation: each line beside the invoices or bills that could settle it, with the reasons in words; tick several to balance it, small FX differences booked for you, rules for next time, and undo.