Bootstrap 5 Subscription Plan Card with Upgrade and Cancel
A billing panel with the current trial plan, price, days left, usage meters and feature list, an upgrade banner, and a quiet cancel row. Both actions open a confirmation modal listing what changes.
<section class="wdw-stage">
<div class="container" style="max-width:820px">
<div class="mb-4"><span class="wdw-eyebrow">Billing</span><h2 class="wdw-heading h3 mt-1 mb-0">Subscription</h2></div>
<div class="wdw-card p-4 p-md-5 py-md-5 mb-3">
<div class="d-flex flex-wrap justify-content-between align-items-start gap-3 mb-4">
<div>
<div class="wdw-muted small mb-1">Your plan</div>
<div class="d-flex align-items-center gap-2"><h3 class="h4 wdw-heading mb-0">Starter Trial</h3><span class="badge rounded-pill text-bg-warning">Trial</span></div>
</div>
<div class="text-md-end"><div class="fs-3 fw-bold text-body-emphasis lh-1">$0 <span class="small fw-normal wdw-muted">/ month</span></div><div class="small wdw-muted mt-1">9 days left in trial</div></div>
</div>
<div class="row g-4">
<div class="col-md-7">
<div class="d-flex justify-content-between small mb-2"><span class="fw-semibold" id="usageLabel">MAUs used</span><span class="wdw-muted" id="usagePct"></span></div>
<div class="progress" style="height:10px" role="progressbar" aria-label="Monthly active users used" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" id="usageBar"><div class="progress-bar rounded-pill" id="usageFill"></div></div>
<div class="d-flex justify-content-between small mt-4 mb-2"><span class="fw-semibold">Projects</span><span class="wdw-muted">2 of 3</span></div>
<div class="progress" style="height:10px" role="progressbar" aria-label="Projects used" aria-valuenow="67" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar rounded-pill" style="width:67%"></div></div>
<p class="wdw-muted small mt-3 mb-0">Usage resets on Jun 20, 2026.</p>
</div>
<div class="col-md-5"><ul class="list-unstyled small d-grid gap-2 mb-0"><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>500 monthly active users</span></li><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>3 projects</span></li><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>Email support</span></li><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>Basic analytics</span></li></ul></div>
</div>
</div>
<div class="wdw-aurora rounded-4 p-4 p-md-5 mb-3 d-flex flex-wrap justify-content-between align-items-center gap-3">
<div class="position-relative"><div class="small fw-bold text-uppercase opacity-75" style="letter-spacing:.08em">Recommended</div><h3 class="h4 fw-bold mb-1 mt-1">Upgrade to Growth</h3><p class="mb-0 opacity-75">5,000 MAUs, priority support and unlimited projects · $49/mo</p></div>
<button type="button" class="btn btn-light rounded-pill px-4 position-relative" data-bs-toggle="modal" data-bs-target="#upgradeModal">Upgrade plan</button>
</div>
<div class="rounded-4 border border-danger-subtle p-3 px-md-4 d-flex flex-wrap justify-content-between align-items-center gap-2">
<p class="small mb-0"><span class="fw-semibold">End subscription.</span> <span class="wdw-muted">Your data is kept for 30 days, then removed.</span></p>
<button type="button" class="btn btn-link text-danger fw-semibold text-decoration-none px-0" data-bs-toggle="modal" data-bs-target="#cancelModal">Cancel subscription</button>
</div>
</div>
<div class="modal fade" id="upgradeModal" tabindex="-1" aria-labelledby="upgradeTitle" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content wdw-card border-0"><div class="modal-body p-4 p-md-5">
<span class="wdw-icon mb-3"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5M5 12l7-7 7 7"/></svg></span>
<h3 class="h5 wdw-heading" id="upgradeTitle">Upgrade to Growth</h3><p class="wdw-muted">$49 per month, billed today. What changes:</p>
<ul class="list-unstyled small d-grid gap-2 mb-4"><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>MAU limit rises from 500 to 5,000</span></li><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>Unlimited projects</span></li><li class="d-flex align-items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="text-primary" style="flex:none" aria-hidden="true"><path d="m5 12 5 5 9-10"/></svg><span>Priority support</span></li></ul>
<div class="d-flex gap-2 justify-content-end"><button type="button" class="btn btn-outline-secondary rounded-pill" data-bs-dismiss="modal">Not now</button><button type="button" class="btn btn-primary rounded-pill" data-bs-dismiss="modal">Confirm upgrade</button></div></div></div></div></div>
<div class="modal fade" id="cancelModal" tabindex="-1" aria-labelledby="cancelTitle" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content wdw-card border-0"><div class="modal-body p-4 p-md-5">
<span class="wdw-icon bg-danger-subtle text-danger mb-3"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 9v4M12 17h.01M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"/></svg></span>
<h3 class="h5 wdw-heading" id="cancelTitle">Cancel your subscription?</h3><p class="wdw-muted">Your data will be removed after 30 days. This cannot be undone. What changes:</p>
<ul class="list-unstyled small d-grid gap-2 mb-4"><li>• Your plan ends today</li><li>• Your projects become read-only</li><li>• Customer data is deleted after 30 days</li></ul>
<div class="d-flex gap-2 justify-content-end"><button type="button" class="btn btn-outline-secondary rounded-pill" data-bs-dismiss="modal">Keep plan</button><button type="button" class="btn btn-danger rounded-pill" data-bs-dismiss="modal">Yes, cancel</button></div></div></div></div></div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
function initUsageMeter() {
const fill = document.getElementById('usageFill');
if (!fill) return;
const used = 307, limit = 500;
const pct = Math.round((used / limit) * 100);
fill.style.width = pct + '%';
fill.classList.toggle('bg-danger', pct >= 95);
fill.classList.toggle('bg-warning', pct >= 80 && pct < 95);
document.getElementById('usagePct').textContent = pct + '%';
document.getElementById('usageLabel').textContent = used + ' of ' + limit + ' MAUs used';
document.getElementById('usageBar').setAttribute('aria-valuenow', pct);
}
initUsageMeter();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.