Wizard
A generic wizard control for checkout, creation and multi-step forms.
import { Wizard } from "@schukai/monster/source/components/form/wizard.mjs";Create account
Collect the basic identity data for the new workspace.
Workspace setup
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.
Create account
Collect the basic identity data for the new account.
Company details
Capture workspace or legal-entity information.
Review
Review the collected data and submit the wizard.
Create account
Collect the basic identity data for the new account.
Company details
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">
<h3>Create account</h3>
<p>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" />
</section>
<section data-monster-option-navigation-label="Company">
<h3>Company details</h3>
<p>Capture workspace or legal-entity information.</p>
<label for="wizard-demo-company">Company</label>
<input id="wizard-demo-company" type="text" placeholder="Monster Inc." />
</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 **/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.
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
}
previous()- {Promise
}
refresh()- {Wizard}
Structural methods
getCurrentIndex()- {number}
getCurrentPanel()- {HTMLElement|null}
null.Static methods
[instanceSymbol]()4.126.0monster-wizard-refreshmonster-wizard-change-requestmonster-wizard-validationmonster-wizard-panel-changemonster-wizard-invalidmonster-wizard-completemonster-wizard-final-panel-show
monster-wizard-navigation. Every direct child panel that defines data-monster-option-navigation-label becomes a wizard panel. Panels sharing the same label are grouped into one main step. Optional sub labels can be defined with data-monster-option-navigation-sub-label.getCSSStyleSheet()data-monster-options must be used.getTag()data-monster-options must be used.Lifecycle methods
Lifecycle methods are called by the environment and are usually not intended to be called directly.
[assembleMethodSymbol]()data-monster-options must be used.Other methods
goTo(targetIndex,)targetIndex{number}: targetIndexundefined{object}: [options]
- {Promise
}
submit()- {Promise
}
validateCurrent()- {Promise
}
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-showmonster-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.