Skip to content

Commerce

Checkout summary panel

CheckoutSummaryPanel — exported from the library at `src/components/checkout/CheckoutSummaryPanel.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 summary panel

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
link*CheckoutSummaryLink—What is being bought and who is selling it.
onReset() => void—Fires when the buyer taps the space branding.
enableDiscountCodesbooleanfalseShows the promo-code control above the breakdown.
onTotalChange(total: number) => void—Quantities and promo codes are owned here, so the payable total is only known here. Reported up for whatever sizes the wallet sheet.
isMobilebooleanfalseRenders the mobile tree (branding row on top, Details accordion) instead of the desktop one. The app read `useIsMobile()`, which returns `false` on the first render and cannot be pinned — as a prop, both trees are renderable.
promoCodesRecord<string, CheckoutPromoCode>{}The redeemable codes. The app kept this table inline; as a prop a story can offer a different set, or none, without a fork.
initialAppliedCodesstring[]—Codes already redeemed on first render. Replaces the app's effect that read `?discountCode=` off `window.location` — the design system never reads the URL, and a story that did would not be static.
initialPromoInputOpenbooleanfalseOpens the promo input on first render, so the entry state is a story.
initialPromoCodestring""Seeds the promo field, e.g. to show the invalid-code message alongside it.
initialPromoErrorstring""Message under the promo field on first render.
autoFocusPromoInputbooleanfalseFocus the promo field when it opens. Off by default so a docs page full of stories does not fight over the caret.
initialMobileExpandedbooleanfalseMobile Details accordion open on first render.
initialDescriptionExpandedbooleanfalseDescription already unclamped on first render.
initialEditingProductIdstring | nullnullId of the line item whose quantity dialog is open on first render — the editable ("empty") cart's stepper. Lets the overlay be a static story.
initialEditingMultiProductIdstring | nullnullSame, for the prefilled multi-item cart's stepper (a dialog on desktop, a bottom sheet on mobile).
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/CheckoutSummaryPanel.tsx
Portability
Copies across unchanged — only the utils import path moves.