Skip to content

Tiered discount banner

A sales card showing the discount that grows with the cart amount (-10% from €50, -15% from €100…) with a progress bar towards the next tier.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

For sales, Black Friday or end-of-year campaigns, a tiered discount encourages shoppers to fill their cart: this component makes it readable at a glance. Three cards show the tiers (reached, next tier, upcoming), the bar moves forward with a marker at each threshold, the message “Only €37.50 left to reach -15%” updates and the summary shows the cart, the discount in euros and the discounted total. “Complete your cart” suggestions add or remove an item in one click. Integration: tiers are set with two attributes on each card (data-brp-tier, data-brp-rate) and your shop only has to update the data-brp-amount attribute when the cart changes; a MutationObserver recalculates everything and a brp:change event passes on the amount, rate and discount. Accessibility: the bar uses role="progressbar" with a value read in euros, the message is announced by a role="status" region, tier states are written out (not conveyed by colour alone), suggestions are 56 px tall aria-pressed buttons with a visible focus. Amounts formatted the French way with Intl.NumberFormat, transform and opacity animations removed with prefers-reduced-motion, AA contrast in light and dark mode, no horizontal scrolling from 360 px, no dependency. Example: a home decor and tableware shop.

Code

Loading the code…

The code of this component in

Archive contents

bandeau-soldes-remise-paliers-html-tailwind.zip3 files · 7 Ko

  • index.html16 Ko
  • README.md5 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • A limited-time offer bar: countdown to a fixed date, one-click copyable promo code and a fallback message once the offer is over.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A Christmas gift guide filtered by budget and theme, with the number of ideas announced and an empty state offering to show everything again.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The last order dates for delivery before Christmas, per shipping method, with the days left worked out from the visitor’s date.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A cart that shows live how much is left to add for free shipping, with a progress bar and recalculated totals.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component