Cart Progress Bar Demo

Interactive Demo

Control the cart progress bar in real-time. Adjust the cart amount and minimum threshold to see how the progress bar and messages update.

34%

Main Demo

Add {{ amount }} more to get FREE shipping! 🚚

Different Themes

Examples of different visual themes you can create with CSS custom properties.

Minimal Theme

{{ amount }} away from free delivery

Bold Theme

🎯 {{ amount }} more for FREE shipping!

Neon Theme

âš¡ Only {{ amount }} until TURBO shipping!

Usage Examples

Basic Setup

<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>

JavaScript API

const progressBar = document.querySelector('cart-progress-bar');

// Set progress percentage directly
progressBar.setPercent(67);

// Update cart amount
progressBar.setCurrentAmount(45.50);

// Change threshold
progressBar.setThresholdAmount(100.00);

// Get current progress info
const info = progressBar.getProgress();
console.log(info.percent, info.isComplete, info.thresholdAmount);

Custom Styling

cart-progress-bar {
  --cart-progress-bar-height: 16px;
  --cart-progress-bar-fill-bg: #ff6b6b;
  --cart-progress-bar-border-radius: 8px;
  --cart-progress-message-font-size: 1rem;
}

Features

🎯 Smart Messaging

Template-based messages with automatic currency formatting and show/hide logic based on completion status.

🎨 Highly Customizable

CSS custom properties for colors, sizing, fonts, and spacing. Easy theming support.

📱 Responsive

Mobile-optimized with responsive breakpoints and touch-friendly interactions.

âš¡ Smooth Animations

Buttery smooth transitions with completion shine effects and progress level indicators.

🔧 Easy Integration

Drop-in web component that works with any framework. Clean JavaScript API for dynamic updates.