j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

Wizard

A multi-step form with a stepper header, the current panel and back/next actions; native buttons with aria-current="step".

stable · light DOM · 4.0.0. Light DOM retains static content, native semantics, label relationships and host composition without duplicating controls.

Live variants

numbered

Step 1 of 3: Project

Markup
<j3w1-wizard id="example-wizard-numbered"><div class="wizard" aria-label="Set up a local project"><ol class="wizard-steps"><li class="wizard-step"><button class="wizard-step-button" type="button" aria-current="step"><span class="wizard-step-marker" aria-hidden="true">1</span><span class="wizard-step-name">Project</span></button></li><li class="wizard-step"><button class="wizard-step-button" type="button" disabled=""><span class="wizard-step-marker" aria-hidden="true">2</span><span class="wizard-step-name">Preferences</span></button></li><li class="wizard-step"><button class="wizard-step-button" type="button" disabled=""><span class="wizard-step-marker" aria-hidden="true">3</span><span class="wizard-step-name">Review</span></button></li></ol><section class="wizard-panel" aria-labelledby="example-wizard-numbered-wizard-title-0"><h3 class="wizard-title" id="example-wizard-numbered-wizard-title-0">Step 1 of 3: Project</h3><label for="example-wizard-numbered-wizard-value-0">Project name</label><input class="text-field-input" id="example-wizard-numbered-wizard-value-0" name="example-wizard-numbered-step-0" required=""></section><section class="wizard-panel" aria-labelledby="example-wizard-numbered-wizard-title-1" hidden=""><h3 class="wizard-title" id="example-wizard-numbered-wizard-title-1">Step 2 of 3: Preferences</h3><label for="example-wizard-numbered-wizard-value-1">Preferences name</label><input class="text-field-input" id="example-wizard-numbered-wizard-value-1" name="example-wizard-numbered-step-1" required=""></section><section class="wizard-panel" aria-labelledby="example-wizard-numbered-wizard-title-2" hidden=""><h3 class="wizard-title" id="example-wizard-numbered-wizard-title-2">Step 3 of 3: Review</h3><p class="wizard-text">All previous values remain available. Complete requests host handling; it does not send a network request.</p></section><div class="wizard-actions"><button class="wizard-back" type="button">Back</button><button class="wizard-next" type="button">Next / complete</button></div></div></j3w1-wizard>

icons

Step 1 of 4: Source

Markup
<j3w1-wizard id="example-wizard-icons"><div class="wizard" aria-label="Set up a local project"><ol class="wizard-steps"><li class="wizard-step"><button class="wizard-step-button" type="button" aria-current="step"><span class="wizard-step-marker" aria-hidden="true">1</span><span class="wizard-step-name">Source</span></button></li><li class="wizard-step"><button class="wizard-step-button" type="button" disabled=""><span class="wizard-step-marker" aria-hidden="true">2</span><span class="wizard-step-name">Workspaces</span></button></li><li class="wizard-step"><button class="wizard-step-button" type="button" disabled=""><span class="wizard-step-marker" aria-hidden="true">3</span><span class="wizard-step-name">Bindings</span></button></li><li class="wizard-step"><button class="wizard-step-button" type="button" disabled=""><span class="wizard-step-marker" aria-hidden="true">4</span><span class="wizard-step-name">Review</span></button></li></ol><section class="wizard-panel" aria-labelledby="example-wizard-icons-wizard-title-0"><h3 class="wizard-title" id="example-wizard-icons-wizard-title-0">Step 1 of 4: Source</h3><label for="example-wizard-icons-wizard-value-0">Source name</label><input class="text-field-input" id="example-wizard-icons-wizard-value-0" name="example-wizard-icons-step-0" required=""></section><section class="wizard-panel" aria-labelledby="example-wizard-icons-wizard-title-1" hidden=""><h3 class="wizard-title" id="example-wizard-icons-wizard-title-1">Step 2 of 4: Workspaces</h3><label for="example-wizard-icons-wizard-value-1">Workspaces name</label><input class="text-field-input" id="example-wizard-icons-wizard-value-1" name="example-wizard-icons-step-1" required=""></section><section class="wizard-panel" aria-labelledby="example-wizard-icons-wizard-title-2" hidden=""><h3 class="wizard-title" id="example-wizard-icons-wizard-title-2">Step 3 of 4: Bindings</h3><label for="example-wizard-icons-wizard-value-2">Bindings name</label><input class="text-field-input" id="example-wizard-icons-wizard-value-2" name="example-wizard-icons-step-2" required=""></section><section class="wizard-panel" aria-labelledby="example-wizard-icons-wizard-title-3" hidden=""><h3 class="wizard-title" id="example-wizard-icons-wizard-title-3">Step 4 of 4: Review</h3><p class="wizard-text">All previous values remain available. Complete requests host handling; it does not send a network request.</p></section><div class="wizard-actions"><button class="wizard-back" type="button">Back</button><button class="wizard-next" type="button">Next / complete</button></div></div></j3w1-wizard>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@4.0.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/wizard.css';
import '@j3w1/ui/register/wizard';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@4.0.0 j3w1-ui copy wizard --out ./vendor/j3w1/wizard

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.
stepnumberCurrent zero-based step.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.
next(): booleanValidate current native controls before advancing.
back(): voidReturn without validation.

events

NameType / signatureMeaning
j3w1-stepCustomEventThe active step changed.
j3w1-completeCustomEventFinal local validation succeeded; the host owns persistence.

Dependencies and verification

Registered components: none. Style dependencies: text-field.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

Wizard wizard

  • Family: Advanced forms
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Native control: native <button>s in an <ol>; the current step carries aria-current=step; the panel is a section named by its heading — APG pattern
  • specified
  • demonstrated

A multi-step form with a stepper header, the current panel and back/next actions; native buttons with aria-current="step".

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
steps.dividercolor.border.dividerapproveduse#482b2bD-041 border.divider: color.primitive.modern.divider.
step.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
step.bg-hovercolor.interaction.hover.bgapproveduse#1c1010D-041 interaction.hover.bg: color.primitive.modern.hover.
step.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
step.text-currentcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
step.indicator-currentcolor.border.selected-indicatorobserveduse#e539352px indicator bar on the selected tab or nav item.
step.text-disabledcolor.text.disabledapproveduse#a3676bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
step.marker-completecolor.status.success.textapproveduse#82d9a0D-041 status.success.text: color.primitive.modern.green.
step.marker-invalidcolor.status.danger.textobserveduse#f07178D-041 readable error text on neutral surfaces and native warning tints.
step.indicator-invalidcolor.status.danger.borderobserveduse#e53935Danger border, 2px on invalid inputs.
panel.bgcolor.surface.defaultapproveduse#0d0707D-041 surface.default: color.primitive.modern.panel.
panel.bordercolor.border.defaultapproveduse#482b2bD-041 border.default: color.primitive.modern.divider.
title.textcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
text.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
message.textcolor.status.danger.textobserveduse#f07178D-041 readable error text on neutral surfaces and native warning tints.
next.bgcolor.action.primary.bgapproveduse#7d1310Primary button fill; D-026 darkened it off color12, which stays fixed as heritage ANSI 12.
next.textcolor.action.primary.textapproveduse#ffa2a7Primary action labels: bright rose across rest, hover and pressed states (D-033).
next.bg-hovercolor.action.primary.hover-bgobserveduse#911410Primary button hover; pair with action.primary.text (D-033).
next.bg-pressedcolor.action.primary.pressed-bgobserveduse#630f0dPrimary button pressed.
next.bordercolor.action.primary.borderobserveduse#9e231fPrimary button border.
next.ringcolor.interaction.focus.ring-containerobserveduse#ffa2a7Focus colour for containers and explicitly mapped filled controls (D-015); component rules determine ring geometry.
back.textcolor.action.secondary.textapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
back.bordercolor.action.secondary.borderapproveduse#986f72D-041 action.secondary.border: color.primitive.modern.control.
back.bg-hovercolor.action.secondary.hover-bgobserveduse#630f0dSecondary button hover.
busy.glyphcolor.action.primary.textapproveduse#ffa2a7Primary action labels: bright rose across rest, hover and pressed states (D-033).

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateNumbered stepsGlyph markers
default

Step 2 of 3: Tokens

Choose the profile the tokens resolve against. The extended overlay can be added later.

✕ Choose a profile before continuing.

Step 3 of 4: Bindings

Keep the existing hjkl bindings or replace them with the imported set.

✕ Two bindings conflict.

hover
focus-visible
current
disabled
invalid
busy

Purpose

A form too long for one screen, split into ordered steps validated one at a time. Steps are not tabs: a future step is unreachable until the steps before it pass.

Anatomy

Parts as listed in the anatomy; the panel heading reads “Step n of m”.

States

StateVisualNon-colour channel
defaultsteps in color.text.default; complete steps carry ✓ in color.status.success.textthe ✓ glyph; the numbers
hoverstep → color.interaction.hover.bg; Next → color.action.primary.hover-bg; Back → color.action.secondary.hover-bgcursor: pointer
focus-visible1px dashed color.interaction.focus.ring ring at −2px; color.interaction.focus.ring-container on Next’s fillthe ring
current2px color.border.selected-indicator under the step; name in color.text.brightaria-current="step"; the indicator bar; the heading reads “Step n of m”
disableda future step in color.text.disabled; no hoverdisabled; cursor: not-allowed; skipped by Tab
invalidmarker becomes ✕ in color.status.danger.text; indicator color.status.danger.border; the panel shows the messageglyph; message text; aria-invalid on the failing fields
busyNext shows the static ⋯ before its label and ignores activation; size unchangedaria-busy on the wizard; the glyph; cursor: progress

Precedence: disabled > busy > invalid > current > hover; focus-visible is always drawn.

Keyboard

As in the key table. A failed Next moves focus to the first invalid field; a successful one to the new panel heading. No arrow keys between steps: the stepper is a list of buttons, not a tablist.

Accessibility

The wizard is a region named by aria-label; the <ol> announces count and position. Complete steps append a visually hidden ”, complete”. Unreachable steps are disabled, not aria-disabled, because they cannot be activated. Validation failures are announced through the form’s live region and the ✕ marker. Text meets 4.5:1; the indicator and rings 3:1; future step text is exempt (house floor 3:1).

Portability

Text, a 2px bottom border and the button tones; markers are text glyphs, no icon font. A toolkit without a native assistant draws the stepper as a row of buttons and records any deviation in the indicator width.

Non-examples

Tabs restyled as steps. A progress bar instead of the stepper. Circles with connecting lines that need a radius. Future steps that look enabled and reject the click. A spinner on Next. Colour-only completion marks. Validation that blocks Back. Animated slides between panels.

Contrast report

19 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 1 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
wizard default textdefaulttextcolor.text.default #e99499color.surface.canvas #0000009.164.5pass
wizard hover texthovertextcolor.text.default #e99499color.interaction.hover.bg #1c10108.104.5pass
wizard focus-visible textfocus-visibletextcolor.text.bright #ffa2a7color.surface.canvas #00000010.984.5pass
wizard focus-visible outlinefocus-visibleuicolor.interaction.focus.ring #e53935color.surface.canvas #0000004.973pass
wizard current textcurrenttextcolor.text.bright #ffa2a7color.surface.canvas #00000010.984.5pass
wizard current bordercurrentuicolor.border.selected-indicator #e53935color.surface.canvas #0000004.973pass
wizard invalid textinvalidtextcolor.status.danger.text #f07178color.surface.canvas #0000007.344.5pass
wizard invalid borderinvaliduicolor.status.danger.border #e53935color.surface.canvas #0000004.973pass
wizard busy textbusytextcolor.action.primary.text #ffa2a7color.action.primary.bg #7d13105.574.5pass
complete marker on the canvas—textcolor.status.success.text #82d9a0color.surface.canvas #00000012.384.5pass
panel title on the panel surface—textcolor.text.bright #ffa2a7color.surface.default #0d070710.454.5pass
panel text on the panel surface—textcolor.text.default #e99499color.surface.default #0d07078.724.5pass
step message on the panel surface—textcolor.status.danger.text #f07178color.surface.default #0d07076.984.5pass
panel edge (decorative)—uicolor.border.default #482b2bcolor.surface.canvas #0000001.661pass
back button text—textcolor.action.secondary.text #ffa2a7color.surface.canvas #00000010.984.5pass
back button boundary—uicolor.action.secondary.border #986f72color.surface.canvas #0000004.853pass
next button boundary—uicolor.action.primary.border #9e231fcolor.surface.canvas #0000002.713waived: the primary button is identified by its text on the fill and by its position; the low-contrast fill and border against the canvas are a documented property of the actions family
ring on the next button's fillfocus-visibleuicolor.interaction.focus.ring-container #ffa2a7color.action.primary.bg #7d13105.573pass
future step text (exempt; house floor 3:1)disableduicolor.text.disabled #a3676bcolor.surface.canvas #0000004.713pass

Keys

KeyAction
Tab / Shift+TabReaches each enabled step button, the panel's fields, then Back and Next; future steps are disabled and skipped.
Enter / SpaceOn a step button, goes to that step if it is reachable; on Next, validates the panel and advances; on Back, returns without validating.
EscapeNothing; leaving a wizard is an explicit Cancel or the host's navigation.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: button fieldset tabs breadcrumbs progress admin-form

Stress fixtures: FX-LONG FX-320 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-STATE-MATRIX