Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Payment card

A card, drawn as its face

A banking app shows the cards a person holds the way they look in a wallet: the issuer along the top, the last four digits, the holder and the expiry with the network's mark along the bottom. The face keeps a real card's proportions at any width, and it is named as one thing, so a screen reader hears whose card it is and which.

Default

Northlight
Plus
ending in 5555
Jordan ReyesExpires 04/29
Orbit

Tones

The default face is solid, the inverse end of the container ramp, so it reads as an object set on the page. The neutral face sits quieter on the ramp, for a virtual card or a second card beside the main one.

Northlight
ending in 5555
Jordan ReyesExpires 04/29
Orbit
Northlight
Virtual
ending in 0142
Jordan ReyesExpires 04/29
Orbit

Frozen

A frozen card dims its face under a lock and says so in words, so the state never rests on the dimming alone.

Northlight
ending in 7781
Jordan ReyesExpires 04/29
Orbit
Frozen

Compact

The compact step suits a list of cards or a rail, at the same proportions.

Northlight
Plus
ending in 5555
Jordan ReyesExpires 04/29
Orbit
Northlight
ending in 0142
Jordan ReyesExpires 04/29
Orbit

Alternatives

  • Use Card instead when the tile previews any other content, or links to a page.

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

PaymentCard props
PropTypeDefaultDescription
brand*
ReactNode
The issuer's wordmark or logo, at the top start of the face. Text, or a node such as an `<img>` with its own alt text. When it is text it also opens the card's accessible name.
holderName*
string
The name printed on the card, at the bottom start.
last4*
string
The last four digits of the card number, drawn as `•• 5555`.
expiry
PaymentCardExpiry
When the card expires, written in `locale` as a two-digit month and year.
network
ReactNode
The card network's mark at the bottom end, such as a logo `<img>` with its alt text.
label
string
A tier or kind printed at the top end, such as "Plus" or "Virtual".
tone
"default" | "neutral"
'default'
The face's colour: `default` is the solid inverse face a card reads as in a wallet, `neutral` a quieter face on the container ramp.
frozen
boolean
false
Draws the card frozen: the face dimmed under a lock and the frozen label.
size
"default" | "compact"
'default'
The face's width step; the height follows from the card's aspect ratio.
locale
string
'en-US'
The BCP 47 locale the expiry is written in, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider.
endingInLabel
string
'ending in'
Read before the last four digits, out of sight. Default "ending in".
expiresLabel
string
'Expires'
Read before the expiry, out of sight. Default "Expires".
frozenLabel
string
'Frozen'
Shown over a frozen face. Default "Frozen".
cardLabel
((parts: PaymentCardLabelParts) => string)
({ brand, holderName, last4 }: PaymentCardLabelParts) => …
The card's accessible name, written from its parts. Default: the brand when it is text, then "card ending in 5555, Jordan Reyes".
className
string
''
Additional CSS classes on the face

Keys

Nothing here takes focus, so there are no keys. A test holds that.

tsx
// From the npm package
import { PaymentCard } from 'rift-ds/components/PaymentCard/PaymentCard';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/payment-card.json

0.9 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.