Playground

States

Empty (label as placeholder), filled (brand-logo slot + number), error, info, and disabled.

On dark surface

Pass onDark on a bold or dark surface — it uses the on-dark token variants.

When to Use

Best for

  • Collecting a payment-card number at checkout
  • Cases where showing the detected card brand reassures the user

Consider alternatives when

Props

PropTypeRequiredDescription
labelstringNoField label (default: "Credit Card")
valuestringNoCard number (controlled). Pair with onChange
defaultValuestringNoInitial value (uncontrolled)
onChange(value: string) => voidNoChange handler
brandLogoReactNodeNoCard-brand logo for the 22×18 slot (clip placeholder until assets land)
errorstring | booleanNoError message (string) or error border only (true)
infostringNoHelper message (hidden while an error is shown)
isDisabledbooleanNoDisable the field
onDarkbooleanNoUse on-dark token variants

Import

import { CardInput } from '@/components/CardInput/eshop';

Wrap in <div data-platform="eshop"> so the eShop typography classes apply. The card-brand logo slot renders a neutral clip placeholder until brand assets are added.

Design Tokens

PurposeToken
Field fillvar(--color-fill-element-field)
Border (default / focused / error)var(--color-border-element-field[-focused|-error])
Value textvar(--color-content-primary)
Brand-logo slotvar(--color-fill-element-neutral-soft)
Error messagevar(--color-content-critical)
Focus ringvar(--color-border-element-focus-ring)
Typography (value / label).body-lg / .body-sm

Related Components

Page tokens