Commerce
Checkout account card
CheckoutAccountCard — exported from the library at `src/components/checkout/CheckoutAccountCard.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 account 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 |
|---|---|---|---|
state* | CheckoutAccountState | — | Which state to render. Fully caller-owned, so each is a static story. |
email* | string | — | Undocumented — add TSDoc to the prop in the library. |
onEmailChange* | (value: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
onSendCode* | () => void | — | empty → code-sent |
onChangeEmail* | () => void | — | code-sent → empty (edit the address) |
onVerified* | () => void | — | code-sent → verified (all six digits entered, matching the demo code) |
onSignOut* | () => void | — | verified → empty |
error | string | null | — | Blocking message from a failed pay attempt, shown under the field that needs attention — the email, or the code once one has been sent. |
initialOtp | string | "" | Digits already in the OTP boxes on first render. Lets "half-typed" and "full" be static stories rather than a keystroke path. |
otpError | string | null | — | Pins the wrong-code message. Overrides whatever the internal typing state would show, so the error state renders without typing a bad code. |
resendSeconds | number | CHECKOUT_ACCOUNT_RESEND_SECONDS | Seconds left on the resend cooldown. A fixed number, not a countdown — the app ran a `setInterval` here and a live timer makes the story non-deterministic. `0` renders the enabled "Resend code" pill. |
onResend | () => void | — | Fires when the buyer asks for another code. |
autoFocusOtp | boolean | false | Move focus into the OTP boxes when the card enters `"code-sent"`. Off by default so a docs page full of stories does not fight over the caret. |
googleIconSrc | string | CHECKOUT_ACCOUNT_GOOGLE_MARK | Brand mark on the Google button. Must be a `data:` URI or bundled asset. |
appleIconSrc | string | CHECKOUT_ACCOUNT_APPLE_MARK | Brand mark on the Apple button. Must be a `data:` URI or bundled asset. |
showSocialSignIn | boolean | true | Hides the Google / Apple row and the "or" divider. |
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/CheckoutAccountCard.tsx- Portability
- Copies across unchanged — only the utils import path moves.