<sectionclass="setup-checklist"aria-labelledby="setup-checklist-title"data-setup-checklist><headerclass="setup-checklist__header"><divclass="setup-checklist__heading"><h3class="setup-checklist__title"id="setup-checklist-title">Get your store ready</h3><pclass="setup-checklist__progress-text"id="setup-checklist-progress"data-setup-text>2 of 5 steps completed</p></div><buttonclass="btn btn--ghost-secondary btn--icon btn--sm"type="button"data-setup-dismisshidden><svgclass="btn__icon"xmlns="http://www.w3.org/2000/svg"viewBox="0 0 24 24"fill="none"stroke="currentColor"stroke-width="2"stroke-linecap="round"aria-hidden="true"focusable="false"><pathd="M18 6 6 18M6 6l12 12"/></svg><spanclass="sr-only">Dismiss the setup guide</span></button></header><progressclass="setup-checklist__progress"max="5"value="2"aria-labelledby="setup-checklist-progress"data-setup-progress>2 of 5</progress><olclass="setup-checklist__steps"role="list"><liclass="setup-checklist__step"data-setup-stepdata-done><detailsname="setup-checklist"><summaryclass="setup-checklist__summary"><spanclass="setup-checklist__marker"aria-hidden="true"></span><spanclass="setup-checklist__step-title">Create your store</span><spanclass="setup-checklist__state"data-setup-state>Completed</span></summary><divclass="setup-checklist__content"><p>Your store name, address and currency are set.</p><divclass="setup-checklist__actions"><buttonclass="btn btn--ghost-secondary btn--sm"type="button"data-setup-togglehidden>Mark as not done</button></div></div></details></li><liclass="setup-checklist__step"data-setup-stepdata-done><detailsname="setup-checklist"><summaryclass="setup-checklist__summary"><spanclass="setup-checklist__marker"aria-hidden="true"></span><spanclass="setup-checklist__step-title">Add your first product</span><spanclass="setup-checklist__state"data-setup-state>Completed</span></summary><divclass="setup-checklist__content"><p>Add a title, a price and at least one photo.</p><divclass="setup-checklist__actions"><buttonclass="btn btn--ghost-secondary btn--sm"type="button"data-setup-togglehidden>Mark as not done</button></div></div></details></li><liclass="setup-checklist__step"data-setup-step><detailsname="setup-checklist"open><summaryclass="setup-checklist__summary"><spanclass="setup-checklist__marker"aria-hidden="true"></span><spanclass="setup-checklist__step-title">Set up payments</span><spanclass="setup-checklist__state"data-setup-state>Not completed</span></summary><divclass="setup-checklist__content"><p>Connect a payment provider to accept cards, wallets and bank transfers. It takes about five minutes.</p><divclass="setup-checklist__actions"><aclass="btn btn--primary btn--sm"href="#">Connect payments</a><buttonclass="btn btn--ghost-secondary btn--sm"type="button"data-setup-togglehidden>Mark as done</button></div></div></details></li><liclass="setup-checklist__step"data-setup-step><detailsname="setup-checklist"><summaryclass="setup-checklist__summary"><spanclass="setup-checklist__marker"aria-hidden="true"></span><spanclass="setup-checklist__step-title">Choose your shipping rates</span><spanclass="setup-checklist__state"data-setup-state>Not completed</span></summary><divclass="setup-checklist__content"><p>Set flat rates, free shipping thresholds or carrier-calculated rates for your zones.</p><divclass="setup-checklist__actions"><aclass="btn btn--primary btn--sm"href="#">Set up shipping</a><buttonclass="btn btn--ghost-secondary btn--sm"type="button"data-setup-togglehidden>Mark as done</button></div></div></details></li><liclass="setup-checklist__step"data-setup-step><detailsname="setup-checklist"><summaryclass="setup-checklist__summary"><spanclass="setup-checklist__marker"aria-hidden="true"></span><spanclass="setup-checklist__step-title">Connect a domain</span><spanclass="setup-checklist__state"data-setup-state>Not completed</span></summary><divclass="setup-checklist__content"><p>Use your own domain name instead of the default store address.</p><divclass="setup-checklist__actions"><aclass="btn btn--primary btn--sm"href="#">Add domain</a><buttonclass="btn btn--ghost-secondary btn--sm"type="button"data-setup-togglehidden>Mark as done</button></div></div></details></li></ol><pclass="sr-only"aria-live="polite"data-setup-live></p></section>
(()=>{
document.querySelectorAll('[data-setup-checklist]').forEach((checklist)=>{const steps =[...checklist.querySelectorAll('[data-setup-step]')];const progress = checklist.querySelector('[data-setup-progress]');const text = checklist.querySelector('[data-setup-text]');const live = checklist.querySelector('[data-setup-live]');const dismiss = checklist.querySelector('[data-setup-dismiss]');constupdate=()=>{const done = steps.filter((step)=> step.hasAttribute('data-done')).length;const message = done === steps.length ?'All steps completed. Your store is ready!':`${done} of ${steps.length} steps completed`;
progress.value = done;
progress.textContent =`${done} of ${steps.length}`;
text.textContent = message;
checklist.classList.toggle('setup-checklist--complete', done === steps.length);return message;};
steps.forEach((step, index)=>{const toggle = step.querySelector('[data-setup-toggle]');
toggle.hidden =false;
toggle.addEventListener('click',()=>{const done = step.toggleAttribute('data-done');
step.querySelector('[data-setup-state]').textContent = done ?'Completed':'Not completed';
toggle.textContent = done ?'Mark as not done':'Mark as done';
live.textContent =`${step.querySelector('.setup-checklist__step-title').textContent}${done ?'completed':'marked as not done'}. ${update()}`;// Open the next step that is not done yet.const next = steps.slice(index +1).concat(steps.slice(0, index)).find((other)=>!other.hasAttribute('data-done'));if(done && next){
next.querySelector('details').open =true;
next.querySelector('summary').focus();}});});
dismiss.hidden =false;
dismiss.addEventListener('click',()=>{
checklist.hidden =true;
checklist.dispatchEvent(newCustomEvent('setup:dismiss',{bubbles:true}));});update();});})();
Setup Checklist
On this page
An onboarding checklist that guides new users through the setup: a progress bar and expandable steps with a call to action each.
Anatomy
.setup-checklist__header: the title, the progress text and an optional dismiss button.
.setup-checklist__progress: a native progress element labelled by the progress text.
.setup-checklist__step: a details element; the summary holds the check __marker, the __step-title and the hidden __state. Completed steps have the data-done attribute.
Accessibility and Usability
The steps are an ordered list of native details elements: they open with the keyboard and screen readers announce them as expandable, without any ARIA.
The name attribute on the details elements makes them an exclusive accordion (only one is open at a time) in modern browsers; older browsers just allow several open steps.
The completion state is hidden text in the summary ("Add your first product, Completed"); the check mark and the strikethrough are visual only.
Marking a step as done announces the new progress and moves the focus to the next open step.
Technical Details
Without JavaScript, the list, the progress and the links work; the script reveals the "Mark as done" and dismiss buttons.
In a real app, mark the steps done on the server when the task is finished (when a product exists, data-done is printed). The manual toggle is for steps you can't detect.
The dismiss button hides the card and dispatches a setup:dismiss event; save the choice so the card stays hidden.
Documentation
Learn about Spruce CSS through our extensive documentation.