Onboarding — Getting-started checklist (progress)
A dismissible getting-started widget that walks new users through five setup tasks — complete a profile, invite teammates, connect a data source, create a project, and tune notifications. Each row carries helper text and an action button, and checking one animates an overall progress indicator and percentage. Completed items collapse with a strike-through, an expand toggle minimizes the card, and a dismiss control hides it entirely. Two live variant switchers swap a progress ring for a bar and the expanded card for a floating progress pill.
MCP
Kod
:root {
--brand: #5b5bf0;
--brand-d: #4646d6;
--brand-700: #3a3ab8;
--brand-50: #eef0ff;
--accent: #00b4a6;
--accent-soft: #d8f5f2;
--ink: #101322;
--ink-2: #3a4060;
--muted: #6c7393;
--bg: #f6f7fb;
--white: #ffffff;
--surface: #ffffff;
--line: rgba(16, 19, 34, 0.1);
--line-2: rgba(16, 19, 34, 0.16);
--ok: #2f9e6f;
--warn: #d98a2b;
--danger: #d4503e;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 20px;
--sh-1: 0 1px 2px rgba(16, 19, 34, 0.08);
--sh-2: 0 8px 24px rgba(16, 19, 34, 0.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
font-family: "Inter", system-ui, -apple-system, sans-serif;
line-height: 1.5;
color: var(--ink);
background: var(--bg);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.page {
max-width: 640px;
margin: 0 auto;
padding: 48px 20px 80px;
}
.page__head { margin-bottom: 24px; }
.page__title {
margin: 0;
font-size: 28px;
font-weight: 800;
letter-spacing: -0.02em;
}
.page__sub {
margin: 6px 0 0;
color: var(--muted);
font-size: 15px;
}
/* Variant switcher */
.switcher {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
margin-top: 20px;
}
.switcher__label {
font-size: 12px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.04em;
}
.switcher__label--2 { margin-left: 8px; }
.seg {
display: inline-flex;
padding: 3px;
background: var(--white);
border: 1px solid var(--line);
border-radius: 10px;
box-shadow: var(--sh-1);
}
.seg__btn {
appearance: none;
border: 0;
background: transparent;
color: var(--ink-2);
font: inherit;
font-size: 13px;
font-weight: 600;
padding: 6px 14px;
border-radius: 7px;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active {
background: var(--brand);
color: #fff;
box-shadow: var(--sh-1);
}
/* Stage */
.stage {
margin-top: 8px;
min-height: 120px;
}
/* Widget card */
.widget {
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--r-lg);
box-shadow: var(--sh-2);
overflow: hidden;
animation: pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop {
from { opacity: 0; transform: translateY(8px) scale(0.98); }
to { opacity: 1; transform: none; }
}
.widget__top {
display: flex;
align-items: center;
gap: 14px;
padding: 18px 20px;
}
.widget__progress {
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
}
/* Ring */
.ring { position: relative; width: 52px; height: 52px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring__track { stroke: var(--brand-50); }
.ring__fill {
stroke: var(--brand);
stroke-linecap: round;
transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring__pct {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-weight: 700;
color: var(--brand-700);
}
.ring.is-complete .ring__fill { stroke: var(--ok); }
.ring.is-complete .ring__pct { color: var(--ok); }
/* Bar */
.bar { width: 64px; }
.bar__count {
font-size: 17px;
font-weight: 800;
color: var(--brand-700);
line-height: 1;
margin-bottom: 6px;
}
.bar__track {
height: 8px;
width: 100%;
background: var(--brand-50);
border-radius: 999px;
overflow: hidden;
}
.bar__fill {
height: 100%;
width: 20%;
background: linear-gradient(90deg, var(--brand), var(--brand-d));
border-radius: 999px;
transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar.is-complete .bar__fill { background: var(--ok); }
.bar.is-complete .bar__count { color: var(--ok); }
.widget__heading { flex: 1 1 auto; min-width: 0; }
.widget__title {
margin: 0;
font-size: 17px;
font-weight: 700;
letter-spacing: -0.01em;
}
.widget__meta {
margin: 2px 0 0;
font-size: 13px;
color: var(--muted);
}
.widget__controls {
flex: 0 0 auto;
display: flex;
gap: 4px;
}
.iconbtn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: 1px solid transparent;
border-radius: var(--r-sm);
background: transparent;
color: var(--muted);
cursor: pointer;
transition: background 0.15s, color 0.15s, transform 0.2s;
}
.iconbtn:hover {
background: var(--bg);
color: var(--ink);
}
.iconbtn svg { transition: transform 0.25s ease; }
#dismissBtn:hover { color: var(--danger); }
/* collapsed chevron rotation */
.widget.is-collapsed #toggleBtn svg { transform: rotate(-90deg); }
/* Task list */
.tasks {
list-style: none;
margin: 0;
padding: 4px 12px 12px;
display: grid;
gap: 2px;
overflow: hidden;
transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
max-height: 1000px;
}
.widget.is-collapsed .tasks {
max-height: 0;
opacity: 0;
padding-top: 0;
padding-bottom: 0;
}
.task {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
border-radius: var(--r-md);
transition: background 0.15s;
}
.task:hover { background: var(--bg); }
.task__check {
flex: 0 0 auto;
width: 24px;
height: 24px;
border-radius: 7px;
border: 2px solid var(--line-2);
background: var(--white);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
color: #fff;
padding: 0;
transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.task__check:hover { border-color: var(--brand); }
.task__tick {
opacity: 0;
transform: scale(0.5);
transition: opacity 0.18s, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.task.is-done .task__check {
background: var(--ok);
border-color: var(--ok);
}
.task.is-done .task__tick {
opacity: 1;
transform: scale(1);
}
.task__body { flex: 1 1 auto; min-width: 0; }
.task__title {
margin: 0;
font-size: 14.5px;
font-weight: 600;
color: var(--ink);
transition: color 0.2s;
}
.task__help {
margin: 1px 0 0;
font-size: 13px;
color: var(--muted);
overflow: hidden;
max-height: 40px;
transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}
.task.is-done .task__title {
color: var(--muted);
text-decoration: line-through;
text-decoration-color: var(--line-2);
}
.task.is-done .task__help {
max-height: 0;
opacity: 0;
margin-top: 0;
}
.task__action {
flex: 0 0 auto;
appearance: none;
border: 1px solid var(--line);
background: var(--white);
color: var(--brand-700);
font: inherit;
font-size: 13px;
font-weight: 600;
padding: 7px 14px;
border-radius: var(--r-sm);
cursor: pointer;
box-shadow: var(--sh-1);
transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.2s;
}
.task__action:hover {
background: var(--brand-50);
border-color: var(--brand);
}
.task__action:active { transform: translateY(1px); }
.task.is-done .task__action {
opacity: 0;
pointer-events: none;
width: 0;
padding-left: 0;
padding-right: 0;
margin-left: -12px;
}
/* Done banner */
.widget__done {
display: flex;
align-items: center;
gap: 12px;
margin: 0 16px 16px;
padding: 14px 16px;
background: var(--accent-soft);
color: #0a6f66;
border-radius: var(--r-md);
animation: pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.widget.is-collapsed .widget__done { display: none; }
.widget__done-title { margin: 0; font-weight: 700; font-size: 14.5px; }
.widget__done-sub { margin: 1px 0 0; font-size: 13px; opacity: 0.9; }
/* Floating pill variant */
.pill {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 10px 18px 10px 10px;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 999px;
box-shadow: var(--sh-2);
cursor: pointer;
font: inherit;
text-align: left;
transition: transform 0.15s, box-shadow 0.15s;
animation: pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.pill:hover {
transform: translateY(-2px);
box-shadow: 0 12px 28px rgba(16, 19, 34, 0.14);
}
.pill__ring {
flex: 0 0 auto;
width: 38px;
height: 38px;
border-radius: 50%;
display: block;
position: relative;
}
.pill__ring::after {
content: attr(data-pct);
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
font-weight: 700;
color: var(--brand-700);
}
.pill__text { display: flex; flex-direction: column; }
.pill__title { font-size: 14px; font-weight: 700; }
.pill__meta { font-size: 12px; color: var(--muted); }
/* Restore button */
.restore {
appearance: none;
border: 1px dashed var(--line-2);
background: var(--white);
color: var(--ink-2);
font: inherit;
font-size: 14px;
font-weight: 600;
padding: 14px 18px;
width: 100%;
border-radius: var(--r-md);
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
}
.restore:hover {
background: var(--brand-50);
border-color: var(--brand);
color: var(--brand-700);
}
/* Focus visibility */
:focus-visible {
outline: 2px solid var(--brand);
outline-offset: 2px;
}
.task__check:focus-visible,
.iconbtn:focus-visible {
outline-offset: 1px;
}
/* Toast */
.toast {
position: fixed;
left: 50%;
bottom: 28px;
transform: translate(-50%, 24px);
background: var(--ink);
color: #fff;
font-size: 13.5px;
font-weight: 500;
padding: 10px 18px;
border-radius: 999px;
box-shadow: var(--sh-2);
opacity: 0;
pointer-events: none;
transition: opacity 0.25s, transform 0.25s;
z-index: 50;
}
.toast.is-visible {
opacity: 1;
transform: translate(-50%, 0);
}
/* Responsive */
@media (max-width: 520px) {
.page { padding: 32px 14px 64px; }
.page__title { font-size: 23px; }
.switcher { gap: 8px; }
.switcher__label--2 { margin-left: 0; width: 100%; }
.widget__top { padding: 16px; gap: 12px; }
.widget__title { font-size: 16px; }
.task { flex-wrap: wrap; padding: 12px 10px; }
.task__body { flex-basis: calc(100% - 36px); }
.task__action {
margin-left: 36px;
width: calc(100% - 36px);
text-align: center;
}
.task.is-done .task__action { margin-left: -12px; width: 0; }
.tasks { padding: 4px 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.001ms !important;
transition-duration: 0.001ms !important;
}
}(function () {
"use strict";
var widget = document.getElementById("widget");
var taskList = document.getElementById("taskList");
var tasks = Array.prototype.slice.call(taskList.querySelectorAll(".task"));
var metaLine = document.getElementById("metaLine");
var progressSlot = document.getElementById("progressSlot");
var doneBanner = document.getElementById("doneBanner");
var toggleBtn = document.getElementById("toggleBtn");
var dismissBtn = document.getElementById("dismissBtn");
var restoreBtn = document.getElementById("restoreBtn");
var pill = document.getElementById("pill");
var pillMeta = document.getElementById("pillMeta");
var pillRing = document.getElementById("pillRing");
var toastEl = document.getElementById("toast");
var TOTAL = tasks.length;
var RING_R = 22;
var RING_C = 2 * Math.PI * RING_R;
var state = {
progress: "ring", // ring | bar
layout: "card", // card | pill
collapsed: false,
dismissed: false
};
// --- Toast helper -------------------------------------------------------
var toastTimer = null;
function toast(msg) {
toastEl.textContent = msg;
toastEl.classList.add("is-visible");
if (toastTimer) clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toastEl.classList.remove("is-visible");
}, 2200);
}
// --- Progress math ------------------------------------------------------
function doneCount() {
return tasks.filter(function (t) {
return t.classList.contains("is-done");
}).length;
}
function pct(done) {
return Math.round((done / TOTAL) * 100);
}
// --- Render progress indicator (ring or bar) ----------------------------
function renderProgress() {
var done = doneCount();
var percent = pct(done);
var complete = done === TOTAL;
if (state.progress === "ring") {
var offset = RING_C * (1 - done / TOTAL);
progressSlot.innerHTML =
'<div class="ring' + (complete ? " is-complete" : "") + '">' +
'<svg viewBox="0 0 52 52" width="52" height="52" role="img" aria-label="' + percent + ' percent complete">' +
'<circle class="ring__track" cx="26" cy="26" r="' + RING_R + '" fill="none" stroke-width="5"></circle>' +
'<circle class="ring__fill" cx="26" cy="26" r="' + RING_R + '" fill="none" stroke-width="5" ' +
'stroke-dasharray="' + RING_C.toFixed(1) + '" stroke-dashoffset="' + offset.toFixed(1) + '"></circle>' +
"</svg>" +
'<span class="ring__pct">' + percent + "%</span>" +
"</div>";
} else {
progressSlot.innerHTML =
'<div class="bar' + (complete ? " is-complete" : "") + '" role="img" aria-label="' + percent + ' percent complete">' +
'<div class="bar__count">' + percent + "%</div>" +
'<div class="bar__track"><div class="bar__fill" style="width:' + percent + '%"></div></div>' +
"</div>";
}
metaLine.textContent =
done + " of " + TOTAL + " tasks done · " + percent + "% complete";
doneBanner.hidden = !complete;
}
// --- Pill mini-ring -----------------------------------------------------
function renderPill() {
var done = doneCount();
var percent = pct(done);
pillRing.setAttribute("data-pct", percent + "%");
pillRing.style.background =
"conic-gradient(" +
(done === TOTAL ? "var(--ok)" : "var(--brand)") +
" " + percent + "%, var(--brand-50) " + percent + "%)";
// mask center to make it a ring
pillRing.style.webkitMask =
"radial-gradient(circle 12px at center, transparent 98%, #000 100%)";
pillRing.style.mask =
"radial-gradient(circle 12px at center, transparent 98%, #000 100%)";
pillMeta.textContent = done + " of " + TOTAL + " done";
}
function refresh() {
renderProgress();
renderPill();
}
// --- Task toggling ------------------------------------------------------
function toggleTask(task) {
var nowDone = !task.classList.contains("is-done");
task.classList.toggle("is-done", nowDone);
var check = task.querySelector(".task__check");
check.setAttribute("aria-checked", nowDone ? "true" : "false");
refresh();
if (doneCount() === TOTAL) {
toast("All set — onboarding complete!");
} else if (nowDone) {
toast("Nice — " + (TOTAL - doneCount()) + " to go");
}
}
tasks.forEach(function (task) {
var check = task.querySelector(".task__check");
check.addEventListener("click", function () {
toggleTask(task);
});
check.addEventListener("keydown", function (e) {
if (e.key === " " || e.key === "Enter") {
e.preventDefault();
toggleTask(task);
}
});
var action = task.querySelector(".task__action");
action.addEventListener("click", function () {
toast(action.getAttribute("data-action") || "Opened");
// simulate completing the step shortly after the action
if (!task.classList.contains("is-done")) {
setTimeout(function () {
toggleTask(task);
}, 600);
}
});
});
// --- Expand / collapse --------------------------------------------------
function setCollapsed(collapsed) {
state.collapsed = collapsed;
widget.classList.toggle("is-collapsed", collapsed);
toggleBtn.setAttribute("aria-expanded", collapsed ? "false" : "true");
toggleBtn.title = collapsed ? "Expand" : "Collapse";
}
toggleBtn.addEventListener("click", function () {
setCollapsed(!state.collapsed);
});
// --- Dismiss / restore --------------------------------------------------
function applyDismiss(dismissed) {
state.dismissed = dismissed;
syncLayout();
restoreBtn.hidden = !dismissed;
}
dismissBtn.addEventListener("click", function () {
applyDismiss(true);
toast("Checklist hidden");
});
restoreBtn.addEventListener("click", function () {
applyDismiss(false);
toast("Checklist restored");
});
// --- Layout variant (card vs pill) -------------------------------------
function syncLayout() {
if (state.dismissed) {
widget.hidden = true;
pill.hidden = true;
return;
}
if (state.layout === "pill") {
widget.hidden = true;
pill.hidden = false;
} else {
widget.hidden = false;
pill.hidden = true;
}
}
pill.addEventListener("click", function () {
setActive(layoutBtns, "card");
state.layout = "card";
widget.dataset.layout = "card";
setCollapsed(false);
syncLayout();
});
// --- Segmented controls -------------------------------------------------
var progressBtns = Array.prototype.slice.call(
document.querySelectorAll("[data-progress]")
);
var layoutBtns = Array.prototype.slice.call(
document.querySelectorAll("[data-layout]")
);
function setActive(group, value) {
group.forEach(function (btn) {
var v = btn.dataset.progress || btn.dataset.layout;
var on = v === value;
btn.classList.toggle("is-active", on);
btn.setAttribute("aria-checked", on ? "true" : "false");
});
}
progressBtns.forEach(function (btn) {
btn.addEventListener("click", function () {
state.progress = btn.dataset.progress;
widget.dataset.progress = state.progress;
setActive(progressBtns, state.progress);
renderProgress();
});
});
layoutBtns.forEach(function (btn) {
btn.addEventListener("click", function () {
state.layout = btn.dataset.layout;
widget.dataset.layout = state.layout;
setActive(layoutBtns, state.layout);
if (state.dismissed) applyDismiss(false);
syncLayout();
});
});
// --- Esc collapses the open card ---------------------------------------
document.addEventListener("keydown", function (e) {
if (e.key === "Escape" && state.layout === "card" && !state.dismissed && !state.collapsed) {
setCollapsed(true);
}
});
// --- Init: first task pre-completed for a realistic 20% start -----------
tasks[0].classList.add("is-done");
tasks[0].querySelector(".task__check").setAttribute("aria-checked", "true");
refresh();
syncLayout();
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Onboarding — Getting-started checklist</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="page">
<header class="page__head">
<h1 class="page__title">Getting-started checklist</h1>
<p class="page__sub">A dismissible setup widget — check off tasks to advance your progress.</p>
<div class="switcher" role="group" aria-label="Display variant">
<span class="switcher__label">Progress</span>
<div class="seg" role="radiogroup" aria-label="Progress style">
<button class="seg__btn is-active" role="radio" aria-checked="true" data-progress="ring" type="button">Ring</button>
<button class="seg__btn" role="radio" aria-checked="false" data-progress="bar" type="button">Bar</button>
</div>
<span class="switcher__label switcher__label--2">Layout</span>
<div class="seg" role="radiogroup" aria-label="Layout state">
<button class="seg__btn is-active" role="radio" aria-checked="true" data-layout="card" type="button">Card</button>
<button class="seg__btn" role="radio" aria-checked="false" data-layout="pill" type="button">Pill</button>
</div>
</div>
</header>
<div class="stage" id="stage">
<!-- Expanded card -->
<section class="widget" id="widget" aria-labelledby="widget-title" data-progress="ring" data-layout="card">
<div class="widget__top">
<div class="widget__progress" id="progressSlot"><!-- progress ring/bar injected here --></div>
<div class="widget__heading">
<h2 class="widget__title" id="widget-title">Set up your workspace</h2>
<p class="widget__meta" aria-live="polite" id="metaLine">1 of 5 tasks done · 20% complete</p>
</div>
<div class="widget__controls">
<button class="iconbtn" id="toggleBtn" type="button" aria-expanded="true" aria-controls="taskList" title="Collapse">
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<button class="iconbtn" id="dismissBtn" type="button" title="Dismiss checklist" aria-label="Dismiss checklist">
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg>
</button>
</div>
</div>
<ul class="tasks" id="taskList">
<li class="task" data-id="profile">
<button class="task__check" type="button" role="checkbox" aria-checked="false" aria-label="Complete your profile">
<svg class="task__tick" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<div class="task__body">
<p class="task__title">Complete your profile</p>
<p class="task__help">Add a photo and a display name so teammates recognize you.</p>
</div>
<button class="task__action" type="button" data-action="Profile opened">Add details</button>
</li>
<li class="task" data-id="invite">
<button class="task__check" type="button" role="checkbox" aria-checked="false" aria-label="Invite your team">
<svg class="task__tick" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<div class="task__body">
<p class="task__title">Invite your team</p>
<p class="task__help">Bring in coworkers — most teams add 3 people in week one.</p>
</div>
<button class="task__action" type="button" data-action="Invite dialog opened">Send invites</button>
</li>
<li class="task" data-id="connect">
<button class="task__check" type="button" role="checkbox" aria-checked="false" aria-label="Connect a data source">
<svg class="task__tick" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<div class="task__body">
<p class="task__title">Connect a data source</p>
<p class="task__help">Sync Northwind CRM or upload a CSV to see live charts.</p>
</div>
<button class="task__action" type="button" data-action="Integrations opened">Connect</button>
</li>
<li class="task" data-id="project">
<button class="task__check" type="button" role="checkbox" aria-checked="false" aria-label="Create your first project">
<svg class="task__tick" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<div class="task__body">
<p class="task__title">Create your first project</p>
<p class="task__help">Start from the Q3 Launch template or a blank board.</p>
</div>
<button class="task__action" type="button" data-action="New project started">New project</button>
</li>
<li class="task" data-id="notify">
<button class="task__check" type="button" role="checkbox" aria-checked="false" aria-label="Set notification preferences">
<svg class="task__tick" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<div class="task__body">
<p class="task__title">Set notification preferences</p>
<p class="task__help">Choose how Atlas pings you about mentions and updates.</p>
</div>
<button class="task__action" type="button" data-action="Preferences opened">Configure</button>
</li>
</ul>
<div class="widget__done" id="doneBanner" hidden>
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true"><circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" stroke-width="1.8"/><path d="M7.5 12.5l3 3 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<div>
<p class="widget__done-title">You're all set!</p>
<p class="widget__done-sub">Every starter task is complete — nice work.</p>
</div>
</div>
</section>
<!-- Floating pill (collapsed layout variant) -->
<button class="pill" id="pill" type="button" hidden aria-label="Open getting-started checklist">
<span class="pill__ring" id="pillRing"></span>
<span class="pill__text">
<span class="pill__title">Getting started</span>
<span class="pill__meta" id="pillMeta">1 of 5 done</span>
</span>
</button>
<!-- Re-show button after dismiss -->
<button class="restore" id="restoreBtn" type="button" hidden>Show checklist again</button>
</div>
</main>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>Getting-started checklist (progress)
A self-contained onboarding widget for the empty-state moment after sign-up. Five realistic setup tasks — completing a profile, inviting the team, connecting a data source like Northwind CRM, creating a first project, and setting notification preferences — each pair a title and one line of helper copy with an action button. Checking a task animates a circular fill and percentage, strikes the title, collapses its helper text, and fades out its action; when all five are done a completion banner appears and a toast confirms the milestone.
Two segmented switchers let you preview the variants live. The progress control swaps between a stroked SVG ring with a center percentage and a compact bar with a numeric readout, both of which recolor green at 100%. The layout control swaps the expanded card for a small floating pill that shows a conic mini-ring and a “3 of 5 done” label; clicking the pill reopens the full card. A chevron toggle collapses the card to just its header, the dismiss “X” hides the widget behind a restore button, and pressing Esc minimizes an open card.
Everything is vanilla — no frameworks, no external assets. Checkboxes use role="checkbox" with aria-checked and respond to Space/Enter, the live meta line announces progress via aria-live, focus-visible rings are kept throughout, and the layout reflows to a single column with stacked action buttons down to 360px. A prefers-reduced-motion block neutralizes the animations.
Illustrative UI only — fictional product, people, and data.