Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Data display
  4. PaymentCard

Data display

PaymentCard

A bank card as a picture: issuer, number ending, holder and expiry on a gradient. Frozen cards turn grey with a snowflake.

import { PaymentCard } from '@alea/ui';

Examples

Cards in a wallet

One tone per card. Screen readers hear one sentence per card.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-accent…

Space

  • --alea-space-2…
  • --alea-space-5…

Radius

  • --alea-radius-lg…

Type

  • --alea-font-family-mono…
  • --alea-font-size-lg…
  • --alea-font-size-sm…
  • --alea-font-size-xs…
  • --alea-font-weight-semibold…

Shadow

  • --alea-shadow-card…
  • --alea-shadow-pop…

Motion

  • --alea-motion-ease-emphasized…

Component

  • --alea-motion-duration-normal…

Props

PaymentCard props

A bank card as a picture: issuer, number ending, holder and expiry on a gradient. One image for screen readers ("Physical card for Ana, ending 4410").

PropTypeDefaultDescription
holderrequiredstring-The name on the card.
last4requiredstring-The last four digits.
brandReactNode-The issuer's name, top left.
classNamestring-Extra class names for the root element.
expirystring-MM/YY.
frozenboolean-Frozen: muted, with a snowflake.
hrefstring-Makes the card a link (to its details), named like the picture.
kindstring-Physical, Virtual, Debit… shown top right.
tone"accent" | "graphite" | "emerald" | "indigo" | "sunset"'accent'The card's color. Default accent (follows the theme).

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

Variants
toneaccentgraphiteemeraldindigosunset
States
Hover
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-payment-card.alea-payment-card-top.alea-payment-card-brand.alea-payment-card-kind.alea-payment-card-number.alea-payment-card-bottom
Data attributes
data-tone=graphitedata-tone=emeralddata-tone=indigodata-tone=sunsetdata-frozen

Accessibility

  • One image for screen readers, named with the kind, holder, ending and whether it is frozen.
  • The text keeps 4.5:1 on every tone.

Do and don't

Do

  • Show only the last four digits.
  • Give each card of a person a different tone.

Don't

  • Don't show a full card number or the security code.

In Figma

Payment card with Tone and Frozen.

Tested with axe, keyboard and screen reader roles