Open this example in the interactive library
Live preview
Source code
// components/UnitPricingBreakdown.tsx
export default function UnitPricingBreakdown({ price = 24 }: { price?: number } = {}) {
return (
<dl>
<dt>Pack of four</dt>
<dd>${price.toFixed(2)}</dd>
<dt>Per item</dt>
<dd>${(price / 4).toFixed(2)}</dd>
</dl>
);
}
