Component Library

← Back to gallery

Rollout progress banner in HTML, CSS and vanilla JS

A copy-paste Rollout progress banner in plain HTML and CSS, with vanilla JavaScript: no framework, no build step, MIT-licensed.

Category: Feedback · Tags: banner, announcement, site, notice

Live preview

Source (copy-ready)

<section class="dcl-banner-rollout-progress" data-dcl-scheme="light" aria-label="Rollout progress banner example">
<div data-split>
  <div data-stack><span data-chip>Phased rollout</span><h2>New reports are being enabled</h2><p>Existing reports stay available during the rollout.</p></div>
  <div data-well data-stack><label>Rollout progress <progress value="2" max="4"></progress></label><p>2 of 4 groups enabled: Receiving and Support.</p></div>
</div>
<script>
(() => {
  const root = document.currentScript.closest(".dcl-banner-rollout-progress");
  const preference = matchMedia("(prefers-color-scheme: dark)");
  const setTheme = () => { root.dataset.dclScheme = preference.matches ? "dark" : "light"; };
  preference.addEventListener("change", setTheme);
  setTheme();
})();
</script>
</section>
<style>
.dcl-banner-rollout-progress, .dcl-banner-rollout-progress * { box-sizing: border-box; }
.dcl-banner-rollout-progress { font: 1rem/1.5 system-ui, sans-serif; max-inline-size: 40rem; padding: clamp(0.75rem, 3vw, 1.25rem); border: 1px solid; border-radius: 0.75rem; overflow-wrap: anywhere; }
.dcl-banner-rollout-progress :where(h2, h3, p, ol, ul, dl, dd) { margin: 0; }
.dcl-banner-rollout-progress h2 { font-size: 1.25rem; line-height: 1.25; }
.dcl-banner-rollout-progress h3 { font-size: 1rem; }
.dcl-banner-rollout-progress p + p { margin-block-start: 0.5rem; }
.dcl-banner-rollout-progress [data-stack], .dcl-banner-rollout-progress form { display: grid; gap: 0.75rem; }
.dcl-banner-rollout-progress [data-row] { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.dcl-banner-rollout-progress [data-split] { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.75rem 1.25rem; align-items: start; }
.dcl-banner-rollout-progress [data-spread] { justify-content: space-between; }
.dcl-banner-rollout-progress [hidden] { display: none !important; }
.dcl-banner-rollout-progress [data-well] { padding: 0.75rem; border-radius: 0.375rem; }
.dcl-banner-rollout-progress [data-chip] { display: inline-block; width: fit-content; padding: 0.125rem 0.55rem; border-radius: 99rem; font-size: 0.875rem; font-weight: 700; }
.dcl-banner-rollout-progress progress { inline-size: 100%; }
.dcl-banner-rollout-progress { color-scheme: light; border-color: #697f84; }
.dcl-banner-rollout-progress { color: #11292f; background-color: #ffffff; }
.dcl-banner-rollout-progress [data-well], .dcl-banner-rollout-progress [data-chip] { color: #11292f; background-color: #e4edef; }
.dcl-banner-rollout-progress[data-dcl-scheme="dark"] { color-scheme: dark; border-color: #839fa5; }
.dcl-banner-rollout-progress[data-dcl-scheme="dark"] { color: #eff8f9; background-color: #142f36; }
.dcl-banner-rollout-progress[data-dcl-scheme="dark"] [data-well], .dcl-banner-rollout-progress[data-dcl-scheme="dark"] [data-chip] { color: #eff8f9; background-color: #1c3c44; }
</style>

When to use

Use this for a phased rollout when people need to know what is already active and what is still pending.

Avoid

Do not use percentages for a rollout with no known denominator.

Accessibility

Native progress is named in a wrapped label. The 2 of 4 count and the active groups are also visible as text. Text contrast is at least 12.7:1 in light and 10.9:1 in dark.

Was this useful? Send feedback.