Skip to content

Commerce

Checkout payment card

CheckoutPaymentCard — exported from the library at `src/components/checkout/CheckoutPaymentCard.tsx`. Awaiting a written description.
Available
Ports as-is

Examples

Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.

Checkout payment card

Rendered live from Storybook

Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.

Props

The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.

PropTypeDefaultDescription
headingstring"Payment details"Heading on the card.
lockedbooleanfalseLocks the whole section until the account is verified. The checkout session is built from the customer record, so there is nothing to collect payment against until that record exists.
forceHintVisiblebooleanfalsePins the locked hint open. The app only ever showed it on hover, which no static story can reach — this renders it at the same measured position.
providerUnavailablebooleanfalseSet once the payment provider has failed to come up (blocked, offline, no key). Falls back to the local card form so the page stays usable. Named for the role, not the vendor: the app called this `stripeUnavailable`.
elementState"loading" | "ready""ready"`"loading"` renders the pulsing placeholder rows the app showed while the provider's iframe mounted — a static story rather than a race.
methodsCheckoutPaymentMethodTab[]CHECKOUT_PAYMENT_METHOD_TABSTabs across the top of the mock element.
initialSelectedMethodstring—Tab selected on first render. Defaults to the first entry.
selectedMethodstring—Fully controlled tab selection.
onSelectionChange(selection: CheckoutPaymentSelection) => void—Undocumented — add TSDoc to the prop in the library.
emailstring—The verified account email, prefilled as the billing address. Only pass it once verified. Rendered read-only — this section collects nothing.
cardErrorsCheckoutCardFormErrors—Messages for the fallback card form. Caller-owned; nothing validates.
classNamestring—Undocumented — add TSDoc to the prop in the library.

Reference

Transcribed from the component audit. If this disagrees with the source, the source is right.

Source
src/components/checkout/CheckoutPaymentCard.tsx
Portability
Copies across unchanged — only the utils import path moves.
Variants
elementState: loading | ready