About this set
Three order summary panels for the side of a cart or checkout. Summary with promo code is a furniture order with thumbnails carrying a quantity bubble, a promo code field with an Apply button, and subtotal, discount, shipping, estimated tax and total lines. The demo accepts SPRING15 for 15 percent off and FREESHIP for free shipping; an applied code shows as a chip with a remove button and a discount line appears, while an unknown code gets an error message tied to the field. Free-shipping progress is a candle order with a bar showing how far the subtotal is from free shipping and an add-on card; ticking the travel tin candle adds $24.00, fills the bar and switches shipping to free. Collapsible summary for phones is a native details element whose summary row shows the total, so the full breakdown can fold away above a mobile checkout. A short script recalculates discount, shipping, tax and total in cents from data attributes on each panel, so the figures always add up, and announces each change politely. Codes are checked in the browser for the demo only, so check them again on the server.
What’s included
- Promo code field with apply, remove, inline error and discount line
- Discount, shipping, tax and total recalculated in cents
- Free-shipping progress bar with an add-on checkbox card
- Collapsible summary built on details and summary, no script
- Quantity bubbles on the product thumbnails
Accessibility
The promo field has a visible label and a hint, and its error message is linked through aria-describedby; the input gets aria-invalid while the message shows and focus returns to it. The applied code chip has a remove button named Remove promo code, quantities are given as visually hidden text, and the shipping bar is a labelled progressbar. Totals are announced through a polite status region, and transitions switch off under prefers-reduced-motion.
Customise it
Change --sm-accent, --sm-line and --sm-soft on .sm. Subtotal, shipping fee, tax rate, free-shipping threshold and promo codes are the data-subtotal, data-ship, data-tax, data-free-over and data-codes attributes. In Tailwind edit the sm-* colours in @theme.






