Skip to content

OrderSummaryLine Container

The OrderSummaryLine container renders individual line items within the order summary such as subtotal, shipping, or tax rows.

Version: 1.1.2

The OrderSummaryLine container provides the following configuration options:

ParameterTypeReq?Description
labelVNode | stringYesYes | Label text or component for the line item.
priceVNode<HTMLAttributes<HTMLSpanElement>>YesPrice component for the line item.
classSuffixesArray<string>NoProvides an array of CSS class suffixes for styling variants. Use to apply different visual styles to order summary line items based on their type or context.
labelClassSuffixstringNoCSS class suffix specifically for the label.
testIdstringNoTest ID for automated testing.
childrenanyNoChild elements to render within the container
initialDataobjectNoPreloaded data for the model before backend data is fetched. Use for testing, SSR, or improving initial load.

This container does not expose any customizable slots.

The following example demonstrates how to use the OrderSummaryLine container:

import { render as provider } from '@dropins/storefront-quote-management/render.js';
import { OrderSummaryLine } from '@dropins/storefront-quote-management/containers/OrderSummaryLine.js';
// In updateLineItems or a slot - lineItem from quote prices/order summary data
const label = lineItem.label ?? 'Subtotal';
const price = document.createElement('span');
price.textContent = lineItem.formattedValue ?? String(lineItem.value ?? 0);
await provider.render(OrderSummaryLine, {
label,
price,
classSuffixes: [lineItem.key]
})(block);