Skip to content

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.

PropTypeDefaultDescription
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
errorstring | 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.
initialOtpstring""Digits already in the OTP boxes on first render. Lets "half-typed" and "full" be static stories rather than a keystroke path.
otpErrorstring | null—Pins the wrong-code message. Overrides whatever the internal typing state would show, so the error state renders without typing a bad code.
resendSecondsnumberCHECKOUT_ACCOUNT_RESEND_SECONDSSeconds 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.
autoFocusOtpbooleanfalseMove 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.
googleIconSrcstringCHECKOUT_ACCOUNT_GOOGLE_MARKBrand mark on the Google button. Must be a `data:` URI or bundled asset.
appleIconSrcstringCHECKOUT_ACCOUNT_APPLE_MARKBrand mark on the Apple button. Must be a `data:` URI or bundled asset.
showSocialSignInbooleantrueHides the Google / Apple row and the "or" divider.
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/CheckoutAccountCard.tsx
Portability
Copies across unchanged — only the utils import path moves.