Wizard
A generic wizard control for checkout, creation and multi-step forms.
import { Wizard } from "@schukai/monster/source/components/form/wizard.mjs";Collect the basic identity data for the new workspace.
Capture the legal or internal workspace name.
Review
The final step can trigger a completion callback.
Introduction
monster-wizard organizes complex forms into guided steps so users can move through long workflows in a controlled sequence.
Key Features
- Step-based flow: Splits larger forms into manageable sections.
- Progress guidance: Helps users understand where they are.
- Validation-friendly: Fits staged form checks and navigation rules.
Wizard Basic
This example uses monster-wizard to split a setup flow into three simple panels with built-in navigation and action buttons.
Collect the basic identity data for the new account.
Capture workspace or legal-entity information.
Review
Review the collected data and submit the wizard.
Collect the basic identity data for the new account.
Capture workspace or legal-entity information.
Review
Review the collected data and submit the wizard.
Javascript
/** this example does not use an extra script **/HTML
<monster-wizard id="wizard-demo">
<section data-monster-option-navigation-label="Account">
<monster-field-set
data-monster-option-labels-title="Create account"
data-monster-option-features-multiplecolumns="false"
>
<p class="grid-span-full">
Collect the basic identity data for the new account.
</p>
<label for="wizard-demo-name">Name</label>
<input id="wizard-demo-name" type="text" placeholder="Jane Doe" />
</monster-field-set>
</section>
<section data-monster-option-navigation-label="Company">
<monster-field-set
data-monster-option-labels-title="Company details"
data-monster-option-features-multiplecolumns="false"
>
<p class="grid-span-full">Capture workspace or legal-entity information.</p>
<label for="wizard-demo-company">Company</label>
<input id="wizard-demo-company" type="text" placeholder="Monster Inc." />
</monster-field-set>
</section>
<section data-monster-option-navigation-label="Finish">
<h3>Review</h3>
<p>Review the collected data and submit the wizard.</p>
</section>
</monster-wizard>Stylesheet
/** no additional stylesheet is defined **/Validated Wizard Transitions
Combines native validation with the wizard's invalid callback and panel-change event.
Review the account details.
Review the account details.
Javascript
import "@schukai/monster/source/components/form/wizard.mjs";
const wizard = document.getElementById("validated-wizard");
const status = document.getElementById("validated-wizard-status");
wizard.setOption("validation.native", true);
wizard.setOption("actions.invalid", () => {
status.textContent = "Complete the required email before continuing.";
});
wizard.addEventListener("monster-wizard-panel-change", event => {
status.textContent = `Opened step ${event.detail?.toIndex + 1}`;
});HTML
<monster-wizard id="validated-wizard">
<section id="account-step" data-monster-option-navigation-label="Account"><label>Email <input type="email" required></label></section>
<section id="review-step" data-monster-option-navigation-label="Review"><p>Review the account details.</p></section>
</monster-wizard>
<output id="validated-wizard-status"></output>Stylesheet
/** no additional stylesheet is defined **/Component Design
The wizard coordinates step content, navigation, and state transitions while leaving form markup and validation logic to the surrounding workflow.
Styling Hooks
activeStep: Controls the currently visible section.labels: Customizes navigation and progress text.::part(...): Styles step containers and navigation regions.
Customizing With Parts
You can adapt the visual appearance through exported parts instead of modifying the internal template. This reference is generated from the current component source.
The component exposes these part names:
actions: Container for the component actions.body: Element representing the body.content: Main content region.control: Outer wrapper of the component.navigation: Element representing the navigation.next: Element representing the next.panel-slot: Element representing the panel slot.previous: Element representing the previous.status: Live component status region.submit: Element representing the submit.
HTML Structure
<monster-wizard></monster-wizard>JavaScript Initialization
const element = document.createElement('monster-wizard');
document.body.appendChild(element);Exported
WizardDerived from
CustomElementOptions
The Options listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the CustomElement.
- since
- deprecated
Properties and Attributes
The Properties and Attributes listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits Properties and Attributes from these parent classes. If you cannot find a specific Properties and Attributes in this list, we recommend consulting the documentation of the CustomElement.
data-monster-options: Sets the configuration options for the collapse component when used as an HTML attribute.data-monster-option-[name]: Sets the value of the configuration option[name]for the collapse component when used as an HTML attribute.
Methods
The methods listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the CustomElement.
Behavioral methods
next()- {Promise<boolean>}
previous()- {Promise<boolean>}
refresh()- {Wizard}
Structural methods
getCurrentIndex()- {number}
getCurrentPanel()- {HTMLElement|null}
null.Static methods
[instanceSymbol]()getCSSStyleSheet()getTag()Lifecycle methods
Lifecycle methods are called by the environment and are usually not intended to be called directly.
[assembleMethodSymbol]()Other methods
goTo(targetIndex,[options])targetIndex{number}: targetIndex[options]{object}: Optional force flag and navigation reason.
- {Promise<boolean>}
submit()- {Promise<boolean>}
validateCurrent()- {Promise<boolean>}
Events
The component emits the following events:
monster-wizard-refreshmonster-wizard-change-requestmonster-wizard-validationmonster-wizard-panel-changemonster-wizard-invalidmonster-wizard-completemonster-wizard-final-panel-show
For more information on how to handle events, see the mdn documentation.