Steppers
Show progress through a sequence of discrete stages.
Live preview
- ✓Account
- 2Profile
- 3Review
HTML
<ol class="xsh-steps" aria-label="Account setup stages">
<li class="xsh-step xsh-step--complete">
<span class="xsh-step__number">✓</span>
<span>Account</span>
</li>
<li class="xsh-step" aria-current="step">
<span class="xsh-step__number">2</span>
<span>Profile</span>
</li>
<li class="xsh-step">
<span class="xsh-step__number">3</span>
<span>Review</span>
</li>
</ol>Installation & markup
Include the local stylesheet and script once on the page, then place the component inside a data-xsh-ui root. The example above works without a build system.
<link rel="stylesheet" href="/dist/xshna-ui.css">
<div data-xsh-ui>
<!-- Add the HTML example above -->
</div>
<script defer src="/dist/xshna-ui.js"></script>Component API
Public classes, attributes and hooks used by this example. Keep the xsh- prefix intact.
| Identifier | Contract |
|---|---|
xsh-steps | Used by the example markup and component styles or behavior. |
xsh-step | Used by the example markup and component styles or behavior. |
xsh-step__number | Used by the example markup and component styles or behavior. |
xsh-step--complete | Used by the example markup and component styles or behavior. |
aria-current=step | Used by the example markup and component styles or behavior. |
Accessibility & keyboard
Use an ordered list and aria-current=step for the active stage. The visual stepper itself is informational.
Implementation note. Pair the stepper with actual form navigation controls and validation; never imply the indicator changes application state.
Interaction contract
Behavioral components use the shared delegated runtime; visual-only primitives rely on semantic HTML and CSS. Runtime controls emit bubbling xsh:* CustomEvents; bind application handlers to those events when server persistence, API data or navigation is required.