Skip to main content
Version: Next (5.0)

Wizard

A wizard guides the user through an ordered group of steps. It shows the list of steps with the current one highlighted, and the panel of the current step. The user moves with buttons whose next-step and prev-step actions are the ones below: press Next and Back in the playground, they run for real.

Live preview
XML
<wizard id="demo" initial-load="enum" target-action="SignupSteps">
<wizard-panel id="account">
<tag type="p" label="Choose the name and the email of the new account." />
</wizard-panel>
<wizard-panel id="plan">
<tag type="p"
label="Pick the plan: monthly or yearly, with or without support." />
</wizard-panel>
<wizard-panel id="payment">
<tag type="p" label="Enter the payment method and accept the conditions." />
</wizard-panel>
</wizard>
<button id="Back" label="Back" style="btn-ghost">
<button-action type="prev-step" target="demo" />
</button>
<button id="Next" label="Next" style="btn-primary">
<button-action type="next-step" target="demo" />
</button>

The controls above write these attributes. The reference lists every attribute, its type and default. Attributes in the XSD reference

AttributeControlValues
wizard-panelSteps234
orientationOrientationhorizontalvertical

The steps come from an enumerated list or a query of the server (initial-load and target-action), and the value of each option is the id of its wizard-panel. Here the stage fills that list with a static one. A step ahead of the current one cannot be clicked: the user reaches it with Next, and can go back to the steps already done.

Recipes​

Sign-up in three steps​

Each wizard panel holds any component. The buttons are placed after the wizard, in a div of their own.

<wizard id="signup" initial-load="enum" target-action="SignupSteps">
<wizard-panel id="who">
<criteria id="Name" component="text" label="Name" placeholder="Full name" />
<criteria id="Email" component="text" label="Email" icon="lucide:mail" />
</wizard-panel>
<wizard-panel id="plan">
<criteria id="Plan" component="select" label="Plan" initial-load="enum" target-action="PlanList" />
</wizard-panel>
<wizard-panel id="done">
<tag type="p" label="All set. Press Next again to stay on the last step." />
</wizard-panel>
</wizard>
<tag type="div">
<button id="Back" label="Back" style="btn-ghost">
<button-action type="prev-step" target="signup" />
</button>
<button id="Next" label="Next" style="btn-primary">
<button-action type="next-step" target="signup" />
</button>
</tag>

Events and actions​

A wizard has no event of its own: the user moves with the buttons, or by clicking a step already done. The actions that move it:

ActionDescription
next-stepMoves to the next step of the wizard in target
prev-stepMoves to the previous step
first-stepMoves to the first step
last-stepMoves to the last step
nth-stepMoves to the step whose id is in the value parameter

A step that holds an invalid field is marked in the list.

More​