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.
| Prop | Type | Default | Description |
|---|---|---|---|
heading | string | "Payment details" | Heading on the card. |
locked | boolean | false | Locks 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. |
forceHintVisible | boolean | false | Pins 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. |
providerUnavailable | boolean | false | Set 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. |
methods | CheckoutPaymentMethodTab[] | CHECKOUT_PAYMENT_METHOD_TABS | Tabs across the top of the mock element. |
initialSelectedMethod | string | — | Tab selected on first render. Defaults to the first entry. |
selectedMethod | string | — | Fully controlled tab selection. |
onSelectionChange | (selection: CheckoutPaymentSelection) => void | — | Undocumented — add TSDoc to the prop in the library. |
email | string | — | The verified account email, prefilled as the billing address. Only pass it once verified. Rendered read-only — this section collects nothing. |
cardErrors | CheckoutCardFormErrors | — | Messages for the fallback card form. Caller-owned; nothing validates. |
className | string | — | 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