Skip to content

Components: Commerce

The commerce building blocks: product cards and grids, the product page parts, cart lines, prices and badges, filters, deal and best-seller pieces, and the forms (contact, newsletter, withdrawal, returns, support).

Generated from apps/theme/src/components/commerce/: 75 files, 84 components. Import a component through the @/components/… path shown, so a fork can override it in src/custom/.

@/components/commerce/add-to-cart-button

apps/theme/src/components/commerce/add-to-cart-button.tsx client component

<AddToCartButton>

PropTypeDescription
skustring
parentSku?string
quantity?number
disabled?boolean
className?string
size?ButtonProps["size"]
selectedOptions?string[]
enteredOptions?Array<{ uid: string; value: string }>
analytics?{ name?: string; price?: number; currency?: string; category?: string; variant?: string; }Product details for the GA4 add_to_cart event, fired on a successful add. Optional — when omitted the event still fires with just the SKU + quantity.
product?{ name?: string; image?: string; price?: number; currency?: string; }Summary of the item being added, forwarded to the post-add confirmation drawer (AddedToCartDrawer) so its "you just added" row is instant and variant-correct. Optional — the drawer falls back to the cart line by sku.

@/components/commerce/blog-post-card-link

apps/theme/src/components/commerce/blog-post-card-link.tsx client component

<BlogPostCardLink>

The clickable shell of <BlogPostCard>, and the only client code in it.

It exists so the card itself stays a server component: the card body is sanitised CMS HTML, and passing it through children keeps that markup — and the sanitiser — out of the client bundle. All this adds is the pointerdown handler that stashes the clicked card in lib/pending-post.ts, the last moment before the navigation starts.

pointerdown rather than onClick: click fires after the browser has already begun the transition, a frame late for a store the loading boundary reads on its first render. A pointerdown that never becomes a click is harmless — the entry expires on its own timer, and the hero's route guard rejects a slug that doesn't match.

PropTypeDescription
postPendingPostCard snapshot handed to the post route's loading boundary on click.
className?string
childrenReactNode

@/components/commerce/blog-post-card-view

apps/theme/src/components/commerce/blog-post-card-view.tsx server component

<BlogPostCardView>

PropTypeDescription
postBlogPost
shortDescriptionHtml?string | nullThe excerpt as ALREADY-SANITISED HTML. Rendered verbatim — the view never sanitises, so the sanitiser stays out of any client bundle that imports it.
className?string
large?booleanWhen true the card uses a larger, hero-style layout. Defaults to false.
priority?booleanEager-load + fetchpriority=high the headline image. Set this for the cards that are above the fold on EVERY viewport — on the blog listings that is the first BLOG_GRID_PRIORITY_COUNT, because the grid collapses to one column on mobile. Off by default so cards in below-the-fold rails (the homepage / PDP / category blog sections) keep lazy-loading.
eager?booleanEager-load the headline image WITHOUT raising its fetchpriority. Set this for cards that are above the fold only on wider viewports (the rest of the desktop grid's first two rows): they must not lazy-load there, while on mobile — where they sit far below the fold — they still queue behind the LCP image instead of competing with it. Ignored when priority is set.

@/components/commerce/blog-post-card

apps/theme/src/components/commerce/blog-post-card.tsx server component

<BlogPostCard>

Props: BlogPostCardProps

@/components/commerce/brand-card

apps/theme/src/components/commerce/brand-card.tsx client component

<BrandCard>

Brand logo card linking to a brand search. Falls back to the first letter when the swatch image is missing. Shared by the brands carousel (home) and the brands page grid; callers pass className for layout differences (e.g. shrink-0 inside the carousel's flex row).

PropTypeDescription
brandManufacturerBrand
className?string
priority?booleanEager-load + fetchpriority=high the logo. Set for cards in the first rows of the brands page (the above-the-fold region) so they don't lazy-load. Off by default so below-the-fold cards (and the homepage brands carousel) stay lazy.

@/components/commerce/breadcrumbs

apps/theme/src/components/commerce/breadcrumbs.tsx server component

<Breadcrumbs>

PropTypeDescription
itemsCrumb[]
className?string
hideLastOnMobile?booleanHide the last crumb (typically the product name) below the lg breakpoint. On the PDP the product title is surfaced as the <h1> right under the breadcrumbs on mobile, so the trailing crumb is redundant there and tends to get squeezed. The separate BreadcrumbSchema JSON-LD is unaffected.

@/components/commerce/cart-gift-badge

apps/theme/src/components/commerce/cart-gift-badge.tsx client component

<CartGiftBadge>

"Free gift" marker for a cart line a gift deal added (Magenx_DealGraphQl deal_gift), with the rule's label when it has one. Renders nothing for an ordinary line.

PropTypeDescription
itemCartItem
className?string

@/components/commerce/cart-item-options

apps/theme/src/components/commerce/cart-item-options.tsx client component

<CartItemOptions>

Renders the selected options for a cart line item: configurable variant attributes (e.g. "Color: Red"), Magento customizable options (which may add cost), and bundle options. Magento already folds customizable-option costs into the line row_total, so the per-option price shown here is purely informational.

Also surfaces cart-rule output for the line: per-line prices.discounts (e.g. a "Buy X get Y" rule applied to this item — informational, since row_total is already net of it) and product price_tiers quantity-break hints ("Buy N+ for X").

PropTypeDescription
itemCartItem
className?string

@/components/commerce/cart-item-prior-price

apps/theme/src/components/commerce/cart-item-prior-price.tsx client component

<CartItemPriorPrice>

EU Omnibus prior-price disclosure for a cart line (Magenx_PriceHistoryGraphQl). Renders only when the item's product is on a catalog reduction (final < regular) and price history has been captured: the labelled "Original" regular price (not struck) plus the required "lowest price in the last N days". Used on the full /cart page only.

The comparison uses the product's catalog regular vs final price (not the cart row total, which also reflects cart-rule discounts and options) because the Omnibus prior price concerns the advertised catalog reduction.

PropTypeDescription
itemCartItem
className?string

@/components/commerce/category-filters

apps/theme/src/components/commerce/category-filters.tsx server component

<CategoryFilters>

Async server component that awaits the (separately-fetched) layered-nav aggregations and renders the client filter drawer. Rendered inside a <Suspense> boundary in CategoryPageContent so the product grid streams first and the filter button fills in once Magento's facet computation completes.

PropTypeDescription
aggregationsPromisePromise<CategoryAggregations>
excludeCodes?string[]Extra attribute codes to hide from the filter drawer for this page.

@/components/commerce/category-product-grid

apps/theme/src/components/commerce/category-product-grid.tsx server component

<CategoryProductGrid>

Renders the category product grid and injects CMS promo cards so they sit flush within the same grid layout as product cards.

Insertion positions are spread evenly across the grid:

  • 1 promo block → inserted after ≈ 50 % of products
  • 2 promo blocks → inserted after ≈ 33 % and ≈ 66 % of products
  • More blocks → evenly distributed across equal segments

This is computed server-side so there is no hydration mismatch.

Rows stay full because the caller sizes the page in cells (see lib/category-grid.ts); this component only has to keep a mid CMS block on a row boundary.

PropTypeDescription
productsProductInterface[]
promoBlocks?CmsBlock[]CMS promo blocks to inject into the grid. Only blocks with content are used.
className?string
columns?ProductGridColumns
bannerSlot?React.ReactNodeOptional node (the special product card) rendered as the first grid item on md+ screens, spanning 2 columns × 1 row (SPECIAL_SLOT_CELLS). Hidden on mobile so the caller can render it full-width above the grid.
cmsMidBlock?React.ReactNodeOptional CMS content block rendered as a full-width row in the middle of the product grid.
analyticsList?AnalyticsListGA4 list this grid represents. When set, the grid fires view_item_list and its cards fire select_item. Omit for lists not worth reporting on.

@/components/commerce/category-promo-card

apps/theme/src/components/commerce/category-promo-card.tsx server component

<CategoryPromoCard>

Renders a single CMS promo block as an ad panel that visually matches the ProductCard grid cell (same aspect-square image area + info strip below).

PropTypeDescription
blockCmsBlock
className?string

@/components/commerce/category-special-card

apps/theme/src/components/commerce/category-special-card.tsx server component

<CategorySpecialCard>

Wide product card for a product flagged special, spanning two cells of the category grid on md+ (and shown full-width above the grid on mobile): image on one side, name / rating / price / short description / CTA on the other.

short_description.html is already sanitized by the engine (getSpecialProducts → sanitizeProductHtml).

PropTypeDescription
productProductInterface
className?string
priority?booleanEager-load + fetchpriority=high the image (the card sits above the fold).

@/components/commerce/category-toolbar-skeleton

apps/theme/src/components/commerce/category-toolbar-skeleton.tsx server component

<CategoryToolbarSkeleton>

Height-matched placeholder for <CategoryToolbar>.

The toolbar is a client component (it reads useSearchParams), so both the category page and the search page render it inside a <Suspense>. Those boundaries used to have NO fallback at all, which meant the wrapping mb-6 flex flex-wrap items-center gap-4 row collapsed to zero height and then expanded once the toolbar rendered — moving the product grid and everything below it, including the newsletter band and footer.

The real row is flex items-center gap-3 whose tallest controls are h-9 (the sort <Select> and the "More" button), so reserving h-9 here holds the exact row height. Keep this in step with category-toolbar.tsx.

PropTypeDescription
showMoreButton?boolean

@/components/commerce/category-toolbar

apps/theme/src/components/commerce/category-toolbar.tsx client component

<CategoryToolbar>

PropTypeDescription
filterSlotReact.ReactNodeThe filter drawer, passed as a slot so it can stream in its own Suspense boundary (its aggregations are fetched separately from the product grid).
currentSortstring
showMoreButton?booleanThe "More" (browse categories) button is category-page flavored; the search page hides it.

@/components/commerce/cms-blocks

apps/theme/src/components/commerce/cms-blocks.tsx server component

<CmsBlocks>

PropTypeDescription
blocksCmsBlock[]
className?string
inline?booleanWhen true, renders without the outer Container wrapper (for use inside panel layouts).
iconMap?Record<string, LucideIcon>Optional map of block identifier → Lucide icon to render next to the block title.
hideTitles?booleanWhen true, suppresses block title rendering for all blocks.
wide?booleanWhen true, renders a full-viewport-width section without any Container wrapper, rounded corners, or borders — matching the header bar's edge-to-edge layout.

@/components/commerce/confirm-email-form

apps/theme/src/components/commerce/confirm-email-form.tsx client component

<ConfirmEmailForm>

Activates an account from the confirmation-email link.

The key is read once and then stripped from the address bar, so it does not linger in history or leak through a Referer header (same reasoning as the reset-password page). Magento's own error is shown on failure — an expired or already-used key and an already-active account each have their own message — with a way to request a fresh link.

No props.

@/components/commerce/contact-form

apps/theme/src/components/commerce/contact-form.tsx client component

<ContactForm>

No props.

@/components/commerce/contact-support

apps/theme/src/components/commerce/contact-support.tsx client component

<ContactSupport>

The contact page's form slot.

With helpdesk guest tickets on, a logged-out visitor gets the full ticket form (department, priority, custom fields). Everyone else — signed-in customers, stores without guest tickets, or a backend where the metadata query fails — keeps the plain contactUs form. With the helpdesk enabled, Magenx_Helpdesk records that submission as a Contact Form ticket too, so either path ends up on record.

No props.

@/components/commerce/copy-button

apps/theme/src/components/commerce/copy-button.tsx client component

<CopyButton>

Copies value to the clipboard and confirms for a moment.

PropTypeDescription
valuestring
labelstringAccessible name (and visible text with showLabel).
copiedLabelstringAnnounced (and shown with showLabel) once copied.
showLabel?boolean
className?stringOverrides the default button sizing (e.g. a compact icon button).

@/components/commerce/cross-sell-products

apps/theme/src/components/commerce/cross-sell-products.tsx client component

<CrossSellProducts>

No props.

@/components/commerce/deal-chips

apps/theme/src/components/commerce/deal-chips.tsx client component

<ProductDealChips>

The row of "miniature chips" shown above the highlighted PDP price: the deal label (e.g. DEAL / FLASH SALE), a live "Time left: 03d 11h 25m 32s" countdown when the campaign is scheduled, and a "Save N%" chip. Renders nothing once the countdown expires (the deal is over) so a stale, past-dated deal disappears without a reload.

PropTypeDescription
dealDealInfo
className?string

@/components/commerce/deal-countdown

apps/theme/src/components/commerce/deal-countdown.tsx client component

<DealCountdown>

Live "03d 11h 25m 32s" countdown to a deal's end instant.

Renders nothing until mounted (so the ticking value never causes a hydration mismatch) and nothing once the deal has expired. The parent computes remaining time from ends_at (emitted as ISO-8601 by Magenx_DealGraphQl), so timezone is irrelevant — the browser diffs against its own clock.

PropTypeDescription
endsAtstringISO-8601 instant the deal ends.
className?string
onExpire?() => voidCalled once the countdown reaches zero (e.g. to hide the deal UI).

@/components/commerce/deals-best-sellers-rows

apps/theme/src/components/commerce/deals-best-sellers-rows.tsx client component

Merchandising rows — current deals, then best sellers — for the pages that have nothing of their own to show: the 404 page and the empty cart.

These two existed as separate components whose bodies were 91 of ~103 lines identical. Everything that actually differed is now a prop: which message namespace supplies the headings, the wrapper spacing, and whether the deals row eagerly loads its images.

Both lists are fetched CLIENT-side, from the cached /api/deals and /api/best-sellers routes (not a live Magento query per visitor through the no-store GraphQL proxy). Client-side is not incidental on the 404 path: it is what keeps the surrounding document non-streamed on the server, so global-not-found can still commit a real 404 HTTP status while these rows hydrate afterwards.

Each row hides itself when it has no products (deals unconfigured, or the best-seller report still warming up), so a store with neither shows nothing rather than two empty headings.

<DealsBestSellersRows>

PropTypeDescription
namespace"NotFound" | "Cart"Message namespace supplying dealsHeading / bestSellersHeading. Both namespaces define the same two keys.
priorityDeals?booleanEager-load the deals row's images. True where the row is the top, above-the-fold content (the empty cart); false where it sits below a heading and search box (the 404 page).
className?string

@/components/commerce/delivery-date-picker

apps/theme/src/components/commerce/delivery-date-picker.tsx client component

<DeliveryDatePicker>

Delivery date picker: a button that opens the shadcn Calendar in a popover.

The server owns the rules (lead time, cut-off, weekdays and closed dates — Magenx_CheckoutFieldsGraphQl): it sends the exact list of selectable dates, and every other day is disabled here. Dates are plain calendar dates ("YYYY-MM-DD") end to end, so no time zone conversion can move the day.

Imported with next/dynamic by the checkout so react-day-picker only loads for stores that turned delivery dates on.

PropTypeDescription
idstring
availableDatesstring[]
valuestring
onChange(iso: string) => void
localestringStore locale, e.g. "de-DE"; picks the calendar's month/weekday names.
placeholderstring
disabled?boolean

@/components/commerce/filter-drawer

apps/theme/src/components/commerce/filter-drawer.tsx client component

<FilterDrawer>

PropTypeDescription
aggregationsAggregation[]
excludeCodes?string[]Extra attribute codes to hide for this render only, on top of the always-excluded internal ones. Used by the brand-matched /search page to hide the manufacturer facet — the grid is already scoped to one brand, so re-filtering by a different one makes no sense there.

@/components/commerce/free-shipping-progress

apps/theme/src/components/commerce/free-shipping-progress.tsx client component

<FreeShippingProgress>

Live "free shipping" progress indicator, shared by the PDP shipping panel (<ProductShippingInfo>) and the full cart page. Shows how much more the shopper needs to add to unlock free shipping — with a progress bar — or an "unlocked" state once the cart qualifies. Every figure comes from status (see useFreeShippingStatus); nothing is computed against the threshold here beyond the bar's fill.

Renders just the row content (icon + text + bar) with no border/background of its own; the caller wraps it (a panel row on the PDP, a bordered strip on the cart) and controls padding via className. Returns null without a status or when every order already ships free (threshold 0).

PropTypeDescription
statusFreeShippingStatus | null
className?string

@/components/commerce/garan-dialog

apps/theme/src/components/commerce/garan-dialog.tsx client component

<GaranDialog>

The dialog behind the GARAN label and the legal guarantee notice. Its own module so both can import it lazily (next/dynamic) on first click: the notice trigger sits in the site-wide footer, and pulling the Radix dialog into every route's first-load JS cost ~14 kB gzipped per route.

PropTypeDescription
openboolean
onOpenChange(open: boolean) => void
titlestring
description?string
className?string
childrenReactNode

@/components/commerce/garan-label

apps/theme/src/components/commerce/garan-label.tsx client component

<GaranLabel>

EU GARAN durability-guarantee label (Implementing Regulation (EU) 2025/1960, Annex II), from the companion Magenx_GaranGraphQl module.

Uses the "nested display" the Commission's guidelines allow: the compact official strip is the trigger, and one click opens the full label with the guarantee-terms and EU-information links next to it. Both images are the official artwork with the fields rendered in by the backend, so they are shown as-is — never recoloured, cropped or overlaid. When the backend could not render an image it sends null, and the accessible text stands in.

The strip is only the link to the full label, and the regulation sets no minimum display size for it online, so it is kept compact (160px wide on the PDP, 140px in cart/checkout/order lines via size="sm") rather than at its native half-resolution width. A thin border frames the strip — outside the artwork, never on it — so it sits in line with the other bordered product-info elements.

Renders nothing when label is null (no qualifying guarantee, or disabled).

PropTypeDescription
labelGaranLabelData | null | undefined
size?"md" | "sm"md for the PDP, sm for cart/checkout/order item lines.
className?string

<GaranLabelList>

Every GARAN label behind a cart line or order item (a bundle can carry several). Renders nothing for an empty or missing list.

PropTypeDescription
labelsReadonlyArray<GaranLabelData> | null | undefined
className?string

@/components/commerce/gift-message-form

apps/theme/src/components/commerce/gift-message-form.tsx client component

<GiftMessageForm>

Per-line gift-message editor for the cart drawer and cart page. Renders only when the store allows item-level gift messages (allow_items) and the product accepts one (gift_message_available). Persists via the cart context's setCartItemGiftMessage, which routes through updateCartItems — sending empty strings clears the message (Magento's GiftMessageInput requires all three fields).

The saved message itself is rendered read-only by <CartItemOptions> (so it also shows in the read-only checkout summary); this component only handles adding / editing / removing it.

PropTypeDescription
itemCartItem

@/components/commerce/helpdesk/guest-ticket-form

apps/theme/src/components/commerce/helpdesk/guest-ticket-form.tsx client component

<GuestTicketForm>

Support ticket form for a logged-out visitor.

Submit-only: the success state shows the ticket code and says the reply comes by email. There is nothing to link to — the conversation continues in the visitor's inbox, and moves into their account if they later register and confirm this address.

PropTypeDescription
metadataHelpdeskMetadata

@/components/commerce/helpdesk/ticket-badges

apps/theme/src/components/commerce/helpdesk/ticket-badges.tsx server component

<TicketStatusBadge>

PropTypeDescription
value?HelpdeskLookupValue | null
className?string

<TicketPriorityBadge>

PropTypeDescription
value?HelpdeskLookupValue | null
className?string

@/components/commerce/helpdesk/ticket-option-fields

apps/theme/src/components/commerce/helpdesk/ticket-option-fields.tsx client component

<TicketOptionFields>

Department, priority and custom-field controls shared by the account new-ticket dialog and the guest ticket form.

Every control is gated on the matching metadata flag, so a form only offers what the merchant enabled. The backend enforces the same rules on its own and rejects anything helpdeskMetadata did not offer.

PropTypeDescription
metadata?HelpdeskMetadata | null
valuesTicketOptionValues
onChange(values: TicketOptionValues) => void
idPrefix?string

apps/theme/src/components/commerce/legal-guarantee-notice.tsx client component

@/components/commerce/newsletter-subscription

apps/theme/src/components/commerce/newsletter-subscription.tsx client component

<NewsletterSubscription>

content is the newsletter CMS block fetched server-side via the layout's cached getCmsBlocks, which sanitizes the HTML at the source (sanitizeBlockContent in engine catalog.ts). It renders in the initial HTML with no client round-trip and is rendered directly — sanitization already happened on the server, so this component does NOT import sanitizeCmsHtml (that would pull the heavy sanitize-html/htmlparser2 parser into the client bundle). When no server content exists, fall back to the translated default copy below.

PropTypeDescription
content?string | null

@/components/commerce/payment-methods-image

apps/theme/src/components/commerce/payment-methods-image.tsx server component

<PaymentMethodsImage>

Static strip of accepted-payment-provider logos.

Served from Magento media (/media/payment-methods.avif) and run through the custom imgproxy loader (src/lib/image-loader.ts), same as the brand logo — so the browser gets a correctly-sized, quality-tuned variant (e.g. /media/payment-methods.avif?width=247&quality=75) instead of the full asset. width/height are the intrinsic dimensions of the source strip (740×240 ⇒ 3.08:1); the call sites scale it with h-* w-auto, so the loader requests ~80px-tall widths and the aspect ratio is preserved (no CLS).

Used in the footer (business-name row + bottom bar) and the cart drawer. Below the fold everywhere, so it stays lazy (no priority).

PropTypeDescription
className?string
alt?string

@/components/commerce/pickup-address

apps/theme/src/components/commerce/pickup-address.tsx server component

<PickupAddress>

A pickup store rendered as an address block: name, postal address, and optionally phone and opening hours.

Shared by the checkout review summary, the order confirmation and the account order detail — all three answer the same question ("where do I collect this?") and must answer it identically, but each sits in its own card chrome, so this renders the contents only and the caller supplies the container.

No hooks and no state: usable from server and client components alike.

PropTypeDescription
locationStorePickupLocation
showPhone?booleanPost-order surfaces show the store's phone (the shopper may need to call about a collection); the checkout review does not — it is not an input to the "place order" decision.

@/components/commerce/product-actions

apps/theme/src/components/commerce/product-actions.tsx client component

<ProductActions>

PropTypeDescription
productProductInterface
className?string
onVariantChange?( variant: { sku: string; name: string; priceRange?: PriceRange | null; priceHistory?: PriceHistory | null; garanLabel?: GaranLabel | null; } | null ) => void

@/components/commerce/product-alert-buttons

apps/theme/src/components/commerce/product-alert-buttons.tsx client component

<ProductAlertButtons>

Price-drop and back-in-stock alert subscribe buttons for the product page.

Renders only for logged-in customers (alerts are tied to a customer id in Magento). The stock-alert button is only shown when the product is out of stock; the price-alert button whenever price alerts are enabled. Each button toggles the subscription and writes the mutation's is_subscribed into the cached status, so the label flips with a single request per click. Visibility honours the store's product_alert_allow_price / product_alert_allow_stock admin flags.

PropTypeDescription
productPick<ProductInterface, "sku" | "stock_status">
className?string

@/components/commerce/product-attachment-chips

apps/theme/src/components/commerce/product-attachment-chips.tsx server component

<ProductAttachmentChips>

Downloadable attachment chips (uploaded files and external links) — the real file path / external URL never reaches this component or the client bundle at all: the PDP query returns only id + display metadata (see fragments.ts), and each chip links to /api/download/{id}, a same-origin route that resolves the id server-side and streams the bytes. Renders nothing when there are no attachments (mirrors ProductFeaturesStrip).

PropTypeDescription
itemsProductAttachment[]
className?string

@/components/commerce/product-blog-rail

apps/theme/src/components/commerce/product-blog-rail.tsx client component

<ProductBlogRail>

The PDP's related blog posts ("Articles you may like"), fetched from /api/product-blog-posts once the shopper scrolls near them.

Streamed with the page until now, which meant every PDP render — and every full-strategy prefetch a product card fires on hover intent — ran the query and carried the posts in its flight payload. Not SEO-bearing: internal links to posts reachable from /blog and the sitemap.

No placeholder, matching the <Suspense fallback={null}> this replaces: most products have no related posts, so reserving a row would shift the page for the majority to save a shift for the few.

Markup mirrors BlogPostsSection, which is a server component; the posts are already sanitised by the route, so cards render through BlogPostCardView.

PropTypeDescription
skustring

@/components/commerce/product-brand-rail

apps/theme/src/components/commerce/product-brand-rail.tsx client component

<ProductBrandRail>

"More from <brand>": a one-row carousel of the product's manufacturer's other products, directly under the product info. Fetched from /api/brand-products (one cached entry per brand) once near the viewport.

It sits high on the page, so the gate uses a tighter rootMargin than the rails further down: with the default 800px it would arm during hydration on most desktops and compete with the hero for the main thread. The skeleton reserves the rail's height so arming and resolving don't shift the description below it; it only collapses in the rare case where the brand has fewer than MIN_BRAND_PRODUCTS other products.

Not SEO-bearing — internal links to PDPs reachable from the category tree, the sitemap and the brand's /search listing.

PropTypeDescription
skustringThe product being viewed — excluded from its own brand's rail.
brandValuestringManufacturer attribute option id (selected_options[].value).
brandLabelstringManufacturer label, for the heading and the "view all" search link.
columnsProductGridColumns

@/components/commerce/product-card

apps/theme/src/components/commerce/product-card.tsx client component

<ProductCardBadges>

Default badge stack.

Precedence is deliberate and easy to get wrong in a fork: a matching deal campaign supersedes the generic "Sale" badge (hasDiscount && !deal), so a discounted product in a campaign shows the campaign's admin-configured label once, not twice.

PropTypeDescription
productProductInterface
isOutOfStockboolean
hasDiscountboolean
isNewbooleanInside the admin "Set Product as New from / to" window, by the viewer's calendar day. Always false during SSR/hydration (see lib/product-new).
dealProductInterface["deal"]Deal campaign (Magenx_DealGraphQl) when one matches; supersedes "Sale".
bestSellerProductInterface["best_seller"]Per-category best-seller placement (Magenx_BestSellerGraphQl).
manufacturerstring | null
isInWishlistboolean
toggleWishlist(event: React.MouseEvent) => void

<ProductCardQuickActions>

Default hover overlay: wishlist toggle.

PropTypeDescription
productProductInterface
isOutOfStockboolean
hasDiscountboolean
isNewbooleanInside the admin "Set Product as New from / to" window, by the viewer's calendar day. Always false during SSR/hydration (see lib/product-new).
dealProductInterface["deal"]Deal campaign (Magenx_DealGraphQl) when one matches; supersedes "Sale".
bestSellerProductInterface["best_seller"]Per-category best-seller placement (Magenx_BestSellerGraphQl).
manufacturerstring | null
isInWishlistboolean
toggleWishlist(event: React.MouseEvent) => void

<ProductCard>

PropTypeDescription
productProductInterface
className?string
priority?booleanEager-load + fetchpriority=high the card image. Set this for cards in the first rows of a listing (the above-the-fold / LCP region) so next/image doesn't lazy-load them — PageSpeed flags every lazy / low-priority image in the initial viewport. Off by default so below-the-fold cards stay lazy.
renderBadges?ProductCardSlotReplace the badge stack over the image. Defaults to ProductCardBadges, which is exported — compose around it rather than reimplementing the best-seller / deal / sale precedence.
renderQuickActions?ProductCardSlotReplace the hover overlay (wishlist by default). Exported as ProductCardQuickActions. An override that adds a control must keep onPointerDown={(e) => e.stopPropagation()} on it — see that component.
renderFooter?ProductCardSlotAppended below the price. Renders nothing by default.
listId?stringThe GA4 product list this card is shown in. When set, clicking through to the product fires select_item. Plain strings/number (not an object) so the memo's shallow compare stays cheap and stable.
listName?string
listIndex?number0-based position of the card within that list.

@/components/commerce/product-coupon-strip

apps/theme/src/components/commerce/product-coupon-strip.tsx client component

<ProductCouponStrip>

One-line coupon hint under the product price (Magenx_DealGraphQl couponDeals). The parent passes only coupons without conditions, in rule priority order, so whatever shows here is accepted by any cart. The list is cached server-side, so the first coupon still live by the browser's clock is picked after mount; before that the first one renders (same on server and client, so no hydration mismatch).

PropTypeDescription
dealsCouponDeal[]

@/components/commerce/product-earn-points

apps/theme/src/components/commerce/product-earn-points.tsx client component

<ProductEarnPoints>

PDP "earn N points with this purchase" hint plus a "How does it work?" modal that explains the reward program entirely from the store's configured settings (earn rate, holding period, redeem value, expiry). Shown to everyone (guests too) when the program is enabled and an earn rate is configured — points are only ever awarded to signed-in customers on invoice, which the modal spells out. The estimate = floor(price × earn_rate), mirroring the server-side earn calculation; the actual total is confirmed after checkout. price is the (variant-aware) final price value.

PropTypeDescription
price?number | null

@/components/commerce/product-features-strip

apps/theme/src/components/commerce/product-features-strip.tsx server component

<ProductFeaturesStrip>

PropTypeDescription
productProductInterface

apps/theme/src/components/commerce/product-gallery-interactive.tsx client component

apps/theme/src/components/commerce/product-gallery-swipe.tsx client component

apps/theme/src/components/commerce/product-gallery.tsx server component

@/components/commerce/product-grid

apps/theme/src/components/commerce/product-grid.tsx server component

<ProductGrid>

PropTypeDescription
productsProductInterface[]
className?string
columns?ProductGridColumns
priority?booleanEager-load + fetchpriority=high the first two rows. Set this ONLY when the grid is the above-the-fold content (e.g. the search results page). Default off so the images lazy-load: most callers render this grid BELOW the fold (PDP related/up-sell/cross-sell, homepage featured, cart cross-sell, blog), where eager-loading every first-row image is wasted bandwidth.
analyticsList?AnalyticsListGA4 list this grid represents. When set, the grid fires view_item_list and its cards fire select_item. Omit for lists not worth reporting on.

@/components/commerce/product-info-column

apps/theme/src/components/commerce/product-info-column.tsx client component

<ProductInfoColumn>

PropTypeDescription
productProductInterface
shortDescriptionHtml?string | nullShort description, already sanitized on the server by the parent (product-page-content.tsx). Passed pre-sanitized so this client component doesn't import sanitizeCmsHtml — that would pull the heavy sanitize-html/htmlparser2 parser into the client bundle and evaluate it on every PDP load.
galleryReactNodeThe server-rendered <ProductGallery>, threaded in as a prop so this client component can own the responsive grid (header above the image on mobile) without pulling the gallery into the client bundle. Passing a server element through a client component keeps it in the server RSC tree, so the LCP <Image priority fetchPriority="high"> and its preload stay static.
couponStrip?ReactNodeServer-streamed coupon strip (Magenx_DealGraphQl coupon deals), rendered under the price. Threaded in like gallery so its data stays on the server; null when no unconditional coupon is live.

@/components/commerce/product-linked-grids

apps/theme/src/components/commerce/product-linked-grids.tsx client component

<ProductLinkedGrids>

The PDP's related / up-sell / frequently-bought-together rails, fetched on scroll, each a one-row carousel of up to RAIL_MAX_PRODUCTS with columns visible. Frequently Bought Together comes from order history (frequently_bought_together_products), not from cross-sells, which are the cart's add-on suggestions (see CrossSellProducts).

These used to be resolved with the page and streamed into the initial response, which meant every visitor paid for them — three grids of card-shaped JSON in the flight payload, plus the post-load hydration of every linked client ProductCard — including the majority who never scroll this far. Now WhenNearViewport arms 800px out and the fetch happens then, or never.

The upstream cost is unchanged either way: /api/product-links runs the same 'use cache' helper with the same 6h TTL and cat_p_<id> tags the server render used, so Magento still sees at most one query per product per window. What this removes is per-visitor payload and main-thread work, which this codebase has already traced as a real drag on the mobile LCP paint.

Nothing here is SEO-bearing: these are internal links to PDPs already reachable from the category tree and the sitemap. Reviews, aggregateRating and the Product JSON-LD stay server-rendered in product-reviews-section.tsx — that separation is the whole point of splitting the old combined relations query.

PropTypeDescription
skustring
columnsProductGridColumns

@/components/commerce/product-new-badge

apps/theme/src/components/commerce/product-new-badge.tsx client component

<ProductNewBadge>

"New" badge for server-rendered surfaces (e.g. the category special card) that cannot call useToday() themselves. Renders nothing during SSR and hydration, then appears on the client inside the admin "Set Product as New from / to" window — same rule as the product card and PDP.

PropTypeDescription
productPick<ProductInterface, "new_from_date" | "new_to_date">
className?string

@/components/commerce/product-price

apps/theme/src/components/commerce/product-price.tsx client component

<ProductPrice>

PropTypeDescription
priceRange?PriceRange | null
className?string
size?"xs" | "sm" | "md" | "lg"
showTaxNote?booleanRender a localized "incl./excl. tax" note beneath the price, driven by the merchant's tax.productPriceDisplay config. Off by default so product cards stay compact; enable it on the product detail page. Also acts as the "detailed / PDP" signal for the EU Omnibus prior-price block (labelled two-line layout vs the compact one-liner on cards).
priceHistory?PriceHistory | nullThe EU Omnibus prior price (Magenx_PriceHistoryGraphQl) — the lowest price applied over the look-back window. When present alongside a reduction the component shows the legally-required "prior price" disclosure.
showPriorPrice?booleanShow the prior-price disclosure when data is available. Defaults to true; pass false where a multi-line price is impractical (e.g. the header search-suggestion dropdown, which links to the PDP that carries it).
showStrikePrice?booleanShow the struck-through regular price beside a reduced final price. Defaults to true; pass false where the old price should not be crossed out (e.g. the header quick-search dropdown).

@/components/commerce/product-rail-lazy

apps/theme/src/components/commerce/product-rail-lazy.tsx client component

<LazyProductRail>

ProductRail split into its own chunk, so embla stays out of the PDP's first-load JS. Render it inside <Suspense fallback={<ProductRailSkeleton/>}>.

A plain React.lazy rather than next/dynamic: every caller is already a client component behind a viewport gate that renders the same skeleton while its data loads, so the Suspense fallback is that skeleton too and the swap is shift-free whichever of data and chunk lands first.

No props.

<ProductRailCardsSkeleton>

One rail's worth of card placeholders: a single clipped row laid out exactly like ProductRail's slides. Deliberately not ProductGridSkeleton — a grid of columns cards wraps to two rows on mobile (4 cards, 2 columns), while the rail is always one row, so the grid skeleton would collapse by a full card height when the rail arrived.

PropTypeDescription
columnsProductGridColumns

<ProductRailSkeleton>

A whole rail section's placeholder: a heading-height bar plus one row of card skeletons, for the gap before a rail's data has arrived.

PropTypeDescription
columnsProductGridColumns
className?string

@/components/commerce/product-rail

apps/theme/src/components/commerce/product-rail.tsx client component

<ProductRail>

A one-row product carousel: columns cards visible, the rest a swipe or an arrow away. The PDP's below-the-fold rails all render through this.

Load it through LazyProductRail (product-rail-lazy.tsx), never import it directly into a route: it pulls in embla, which has no business in a PDP's first-load JS when most visitors never scroll to a rail.

Card images keep ProductCard's default lazy loading — browsers apply the lazy-load distance to scroll containers too, so off-screen slides fetch nothing until they approach the viewport.

PropTypeDescription
productsProductInterface[]
columnsProductGridColumnsWidest (desktop) column count — how many cards are visible at once.
analyticsList?AnalyticsListGA4 list; when set the rail fires view_item_list and cards select_item.
labelstringAccessible name for the carousel region (usually the section heading).

@/components/commerce/product-reviews

apps/theme/src/components/commerce/product-reviews.tsx client component

<ProductReviews>

PropTypeDescription
skustring
initialReviewsProductReview[]The first (and, today, only) page of reviews — GET_PRODUCT_REVIEWS fetches pageSize: 10, and there is no load-more path. A totalPages prop used to be threaded in here and was never read; it was dropped rather than left as dead plumbing. Add it back alongside a real paginator, not before.
ratingsSummary?number
reviewCount?number

@/components/commerce/product-share-buttons

apps/theme/src/components/commerce/product-share-buttons.tsx client component

<ProductShareButtons>

PropTypeDescription
productIdnumber
productNamestring

@/components/commerce/product-shipping-info

apps/theme/src/components/commerce/product-shipping-info.tsx client component

<ProductShippingInfo>

PDP "shipping & returns" panel shown below the add-to-cart button, replacing the old product_shipping_info / product_returns_policy CMS blocks with a live, structured presentation:

  1. Free-shipping progress — the cart's status from Magento's Free Shipping carrier: how much more the shopper needs to add to unlock free shipping (or a "you've unlocked it" state once the cart qualifies), with a progress bar.
  2. Delivery estimate — the configured working-days window.
  3. Returns policy — the configured return window in days.

Lines 2 and 3 come from config.shipping (mirror it to your Magento shipping setup); line 1 from Magento itself. Each line self-hides when its value is empty/zero, so a store that only wants the delivery line just leaves the others unset.

No props.

@/components/commerce/product-sticky-bar

apps/theme/src/components/commerce/product-sticky-bar.tsx client component

<ProductStickyBar>

Bottom-of-screen strip on the PDP: thumbnail, name, price, quantity and add-to-cart, shown once the shopper has scrolled past the main add-to-cart row, so they keep both context and the action while reading the description, reviews and rails.

Rendered by ProductActions, which owns the selection and quantity state, so the bar adds no server data and no request of its own: it reuses the product already in the client payload and the same add-to-cart props. Until it first appears it renders nothing, so its thumbnail is fetched only for shoppers who scroll that far.

Shown when the main row is above the viewport (scrolled past, not merely below the fold on a phone) and hidden while the site footer is on screen, so the footer's last row is never covered.

PropTypeDescription
targetRefRefObject<HTMLElement | null>The main add-to-cart row; the bar shows once it is scrolled past.
optionsRefRefObject<HTMLElement | null>Scrolled into view when options still have to be chosen.
namestring
image?string
priceRange?PriceRange | null
quantitynumber
onQuantityChange(next: number) => void
maxQuantity?number
needsSelectionbooleanRequired options (variant / custom) are still unset.
addToCartComponentProps<typeof AddToCartButton>

@/components/commerce/product-subscription-info

apps/theme/src/components/commerce/product-subscription-info.tsx client component

<ProductSubscriptionInfo>

PDP subscription panel. Renders the recurring-billing terms (interval, free trial, one-time setup fee) for a product configured as a Stripe subscription. Returns null for ordinary products, so it's safe to render unconditionally.

The recurring price itself is the product's catalog price (shown by <ProductPrice> above this panel); here we add the cadence + trial + fee that the price alone doesn't convey.

PropTypeDescription
subscription?StripeProductSubscription | null

@/components/commerce/quantity-stepper

apps/theme/src/components/commerce/quantity-stepper.tsx client component

<QuantityStepper>

− / quantity / + control for adding several units at once (PDP and its sticky bar). Controlled: the parent owns the value so both controls stay in step. The number is a real input, so a shopper can also type a quantity; anything outside 1..max is clamped on blur.

max is only known when Magento reports a low stock level (only_x_left_in_stock); otherwise the upper bound is left to Magento, whose add-to-cart error ("The requested qty is not available") the button already surfaces.

PropTypeDescription
valuenumber
onChange(next: number) => void
max?number
size?"sm" | "lg"lg matches the PDP's xl add-to-cart button (h-14), sm the sticky bar's.
disabled?boolean
className?string

@/components/commerce/recently-viewed-section

apps/theme/src/components/commerce/recently-viewed-section.tsx client component

<RecentlyViewedSection>

Recently viewed products, read from localStorage — no network request for the list itself. Still behind WhenNearViewport: mounting up to RAIL_MAX_PRODUCTS client ProductCards plus the carousel chunk is main-thread work the visitors who never scroll this far shouldn't pay for. The gate's fallback is null, exactly what this rendered before its localStorage read anyway.

PropTypeDescription
currentProductUidstring
columns?ProductGridColumnsWidest (desktop) column count, so this rail lines up with the related / up-sell rails above it on the PDP. The page passes layout.productGridColumns; this component is a client component and so must not read #config itself. It is how many cards are visible at once; the rail itself carries up to RAIL_MAX_PRODUCTS.

@/components/commerce/recently-viewed-tracker

apps/theme/src/components/commerce/recently-viewed-tracker.tsx client component

<RecentlyViewedTracker>

PropTypeDescription
productRecentlyViewedItem

@/components/commerce/referral-apply-notice

apps/theme/src/components/commerce/referral-apply-notice.tsx client component

<ReferralApplyNotice>

Sends the share-link code to applyRewardReferralCode once, then shows the coupon it issued. Magento's answer settles the cookie either way: a coupon, or a refusal (not new any more, already referred, own code, unknown code) is final, so the cookie is cleared and a refusal stays silent — the visitor never asked for anything on this page. Only a network failure keeps the cookie, for the next page view to retry.

PropTypeDescription
codestring
onDone() => void

@/components/commerce/referral-auto-apply

apps/theme/src/components/commerce/referral-auto-apply.tsx client component

<ReferralAutoApply>

Applies the referral code a visitor arrived with (the magenx_ref cookie, see lib/referral.ts) as soon as they are signed in — whichever way they signed in — and tells them about their coupon.

No props.

@/components/commerce/returns/create-return-form

apps/theme/src/components/commerce/returns/create-return-form.tsx client component

<CreateReturnForm>

Item-selection + reason/resolution form shared by the customer and guest create-return flows. It fetches the selectable reasons / resolution types / conditions itself (companion returnAttributesMetadata query) and hands the validated payload to onSubmit; the caller attaches the order identity (order_id for customers, order_number + email for guests) and runs the right mutation.

PropTypeDescription
itemsReturnableItem[]
submittingboolean
errorMessage?string | null
onSubmit(payload: CreateReturnPayload) => void
onCancel() => void

@/components/commerce/returns/return-detail-view

apps/theme/src/components/commerce/returns/return-detail-view.tsx client component

<ReturnDetailView>

Presentational view of a single RMA: header (status / reason / resolution), the returned items, and the comment thread. The optional commentForm slot lets the customer dialog inject an "add comment" form (guests can read comments but the backend rejects guest comments, so they pass nothing).

PropTypeDescription
dataCustomerReturn
commentForm?React.ReactNode

@/components/commerce/reward-points-redeem

apps/theme/src/components/commerce/reward-points-redeem.tsx client component

<RewardPointsRedeem>

Checkout reward-points redemption widget. Renders only for signed-in customers when the program is enabled and there is something to redeem. The limits come from the module (max_applicable_points already accounts for the cart value, the per-order maximum and the balance), so nothing is recalculated here. Applying / removing returns the cart's reward block and prices, so the OrderSummary's cached cart (GET_CART_FOR_CHECKOUT) updates in place.

PropTypeDescription
cartIdstring

@/components/commerce/search-results-drawer

apps/theme/src/components/commerce/search-results-drawer.tsx client component

<SearchResultsDrawer>

Right-side drawer for the "which categories do these results fall into" breakdown — the same pills that used to render as an always-visible box between the toolbar and the grid, now tucked behind a "Results" button so the toolbar row stays compact. Trigger renders immediately (see SearchResultsButton in search/page.tsx); only this component needs to be a client component, since it owns the Sheet's open/close state.

PropTypeDescription
facetSearchCategoryFacets
resultsLabelstring
categoriesLabelstring
clearLabelstring
spSearchParams

@/components/commerce/send-to-friend-dialog

apps/theme/src/components/commerce/send-to-friend-dialog.tsx client component

<SendToFriendDialog>

PropTypeDescription
productIdnumber
productNamestring

@/components/commerce/star-rating

apps/theme/src/components/commerce/star-rating.tsx client component

<StarRating>

Star rating display / picker. Shared by the PDP review list+form (product-reviews.tsx) and the account "My Reviews" tab.

rating is a 1–max value (NOT Magento's 0–100 average_rating — callers convert with Math.round(average_rating / 20) before passing it in).

The interactive picker is a group of native radios (visually hidden, one per star, each wrapped in the <label> that draws it). It previously put role="radio" on the <svg> itself, which is not focusable and had no onKeyDown — the picker could not be operated from a keyboard at all. Native radios sharing a name give roving focus and arrow keys for free, and match the deliberately-native approach documented in ui/checkbox.tsx.

NOTE: the aria labels below are hardcoded English, as they were before this component was reworked. Translating them needs new keys in all five locale files, so it is left as separate work.

PropTypeDescription
ratingnumber
max?number
interactive?boolean
onSelect?(value: number) => void
size?"default" | "sm"

@/components/commerce/store-locator

apps/theme/src/components/commerce/store-locator.tsx client component

<StoreLocator>

Contact-page store locator: the merchant's physical stores (from Magento's storePickupLocations) as a selectable address list beside an embedded Google map of the selected store.

The map uses @next/third-parties' GoogleMapsEmbed (a pure iframe, no JS SDK). When no API key is configured it degrades to the address list plus an "Open in Google Maps" link per store, so the locator is always useful.

PropTypeDescription
locationsStorePickupLocation[]
apiKeystring

@/components/commerce/stripe-payment-form

apps/theme/src/components/commerce/stripe-payment-form.tsx client component

<StripePaymentForm>

Renders the Stripe PaymentElement inside an Elements provider. Exposes createPaymentMethodId() via ref so the parent checkout form can tokenise the card before calling setPaymentMethodOnCart.

Usage: const stripeRef = useRef<StripePaymentFormHandle>(null); const pmId = await stripeRef.current.createPaymentMethodId();

No props.

@/components/commerce/withdrawal-form

apps/theme/src/components/commerce/withdrawal-form.tsx client component

<WithdrawalForm>

The withdrawal declaration. Every field is free text, as the consumer states it: there is no order lookup, and "I confirm withdrawal" is the legal act. Staff identify the order and handle the return afterwards.

Normally submitted through submitWithdrawal (helpdesk ticket + confirmation email). When the backend lacks it, the form switches to the contactUs email and asks for one more confirmation — the Turnstile token was spent.

No props.