Cart Progress Bar
A free-shipping threshold bar with currency formatting and themeable fills.
v2.0.0@magic-spells/cart-progress-bar
Live demo
Your cart
$24.00Free shipping at $75.00
Try it live — the bar filling toward the threshold as the total climbs.
About
A beautiful, accessible cart progress bar web component for free shipping thresholds and e-commerce sites.
Features
- 🎯 Smart Messaging - Template-based messages with an [amount] placeholder
- 🎨 Simplified Theming - Just 6 CSS variables to control all colors and appearance
- 📱 Responsive - Mobile-optimized with responsive breakpoints
- ⚡ Smooth Animations - Buttery smooth transitions and completion effects
- 🔧 Easy Integration - Drop-in web component that works with any framework
Usage
<cart-progress-bar threshold="75.00" current="25.50" message-above="🎉 Congratulations! You've qualified for FREE shipping!" message-below="Add $[amount] more for FREE shipping!"> <p data-content-cart-progress-message>Add $[amount] more for FREE shipping!</p> <progress-bar></progress-bar> </cart-progress-bar>
Attributes
| Attribute | Description | Example |
|---|---|---|
| threshold | Threshold amount for free shipping | "75.00" |
| current | Current cart amount | "25.50" |
| message-above | Success message when threshold is reached | "🎉 FREE shipping unlocked!" |
| message-below | Message template shown below the bar | "Add $[amount] more!" |
| money-format | Shopify money format string; uses {{amount}} placeholders and formats the amount that fills [amount] in the messages | "${{amount}}" |
| listen-selector | closest() selector for the element to listen on | "cart-panel" (default) |
| listen-event | Event name to listen for on that element | "cart-panel:data-changed" (default) |
About, features, usage and options are taken from the package README.