Wizard steps
BetaNavigationOpen in the workshop
Where the user is in a multi-step flow, and what is done.
ol.xg-stepper > li.xg-step (> span) · [aria-current="step"] · .is-done · .is-error · --vertical · wrapper [data-xg-wizard] with [data-step] panels and [data-xg-wizard-next]/[data-xg-wizard-back]Example and markup
Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.
- Details
- Budget
- Targeting
- Review
- Budget
- $500 / day
- Devices
- Desktop, Mobile
Markup
<div class="xg-card" data-xg-wizard data-done="Campaign launched">
<ol class="xg-stepper" aria-label="New campaign">
<li class="xg-step">
<span>Details</span>
</li>
<li class="xg-step">
<span>Budget</span>
</li>
<li class="xg-step">
<span>Targeting</span>
</li>
<li class="xg-step">
<span>Review</span>
</li>
</ol>
<div style="padding-top:20px">
<div data-step class="xg-stack">
<div class="xg-field">
<label class="xg-label" for="wz-name">Campaign name</label>
<input class="xg-input" id="wz-name" required placeholder="e.g. Spring launch">
</div>
</div>
<div data-step class="xg-stack" hidden>
<div class="xg-field">
<label class="xg-label" for="wz-budget">Daily budget</label>
<div class="xg-input-group">
<span class="xg-input-group__prefix">$</span>
<input class="xg-input" id="wz-budget" required value="500">
</div>
</div>
</div>
<div data-step class="xg-stack" hidden>
<fieldset class="xg-fieldset">
<legend class="xg-label">Devices</legend>
<label class="xg-check">
<input type="checkbox" checked>Desktop</label>
<label class="xg-check">
<input type="checkbox" checked>Mobile</label>
<label class="xg-check">
<input type="checkbox">CTV</label>
</fieldset>
</div>
<div data-step hidden>
<dl class="xg-dl">
<dt>Budget</dt>
<dd>$500 / day</dd>
<dt>Devices</dt>
<dd>Desktop, Mobile</dd>
</dl>
</div>
</div>
<div class="xg-card__footer">
<button class="xg-btn xg-btn--secondary" type="button" data-xg-wizard-back>Back</button>
<button class="xg-btn" type="button" data-xg-wizard-next data-finish="Launch campaign">Continue</button>
</div>
</div>States
Hover, focus and pressed are forced here with .is-hover, .is-focus and .is-active so they can be seen side by side; in a product they come from :hover, :focus-visible and :active.
| State | Step |
|---|---|
| To do |
|
| Current |
|
| Done |
|
| Error |
|
Variants
- Details
- Budget
- Targeting
- Review
Markup
<ol class="xg-stepper" aria-label="Example">
<li class="xg-step is-done">
<span>Details</span>
</li>
<li class="xg-step is-error">
<span>Budget</span>
</li>
<li class="xg-step" aria-current="step">
<span>Targeting</span>
</li>
<li class="xg-step">
<span>Review</span>
</li>
</ol>When to use it
Use it for
creating a campaign, onboarding, connecting a demand partner: three to six steps.
Not for
one-page forms; more than six steps (split the flow).
Rules
- Step names are nouns: Details, Budget, Targeting, Creatives, Review.
- Continue validates the current step only; Back never loses input.
- Completed steps show a check and can be revisited; future steps cannot be skipped to.
- The last button says what happens: “Launch campaign”, not “Finish”.
Accessibility
- <ol> with aria-current="step"; the step count is announced (“Step 2 of 4, Budget”). Focus moves to the first field of the new step.
Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.
Related
Also in Navigation: Sidebar navigation, Topbar, Tabs, Breadcrumb, Dropdown menu. Used in the patterns Onboarding and sign-up.
Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).