Skip to content

Wizard Classic

The Wizard Classic component provides a step-by-step interface for guiding users through multi-step processes or forms. It features customizable navigation buttons, page transitions, and various styling options.

<div data-role="wizard-classic">
<div class="page">Page 1 Content</div>
<div class="page">Page 2 Content</div>
<div class="page">Page 3 Content</div>
</div>
ParameterTypeDefaultDescription
buttonsstring"next, prev, finish, cancel, help"Comma-separated list of buttons to display
startPagenumber1The initial page to show (1-based index)
heightnumber300Height of the wizard in pixels
labelNextstring""Custom label for the Next button
labelPrevstring""Custom label for the Previous button
labelHelpstring""Custom label for the Help button
labelFinishstring""Custom label for the Finish button
labelCancelstring""Custom label for the Cancel button
iconNextstring""HTML for the Next button icon
iconPrevstring""HTML for the Previous button icon
iconHelpstring""HTML for the Help button icon
iconFinishstring""HTML for the Finish button icon
iconCancelstring""HTML for the Cancel button icon
clsWizardstring""Additional CSS class for the wizard container
clsPagestring""Additional CSS class for wizard pages
clsActionsstring""Additional CSS class for the actions container
clsActionHelpstring""Additional CSS class for the Help button
clsActionPrevstring""Additional CSS class for the Previous button
clsActionNextstring""Additional CSS class for the Next button
clsActionFinishstring""Additional CSS class for the Finish button
clsActionCancelstring""Additional CSS class for the Cancel button
EventDescription
onBeforePageFires before changing the page. Return false to prevent page change.
onPageFires when the page changes
onNextFires when the Next button is clicked
onPrevFires when the Previous button is clicked
onFinishFires when the Finish button is clicked
onCancelFires when the Cancel button is clicked
onHelpFires when the Help button is clicked
onWizardCreateFires when the component is created
  • next() - Navigate to the next page.
  • prev() - Navigate to the previous page.
  • destroy() - Destroy the component and remove it from the DOM.
const wizard = Metro.getPlugin('#myWizard', 'wizard-classic');
wizard.next();

You can also use jQuery-style access:

$(element).data('wizard-classic').next();
VariableDefault (Light)Dark ModeDescription
--wizard-classic-border-color#f3f3f3-Border color of the wizard
--wizard-classic-background#ffffff-Background color of the wizard
--wizard-classic-color#191919-Text color of the wizard
#my-wizard {
--wizard-classic-border-color: #dcdcdc;
--wizard-classic-background: #f8f8f8;
--wizard-classic-color: #333333;
}
  • .wizard-classic - Main container class (automatically added)
  • .wizard-pages - Container for pages
  • .page - Individual page class
  • .active - Applied to the currently visible page
  • .out - Applied to a page that’s being moved out
  • .disabled - Applied to buttons that are disabled in the current state
  • .wizard-actions - Container for action buttons
  • .wizard-help - Help button
  • .wizard-prev - Previous button
  • .wizard-next - Next button
  • .wizard-finish - Finish button
  • .wizard-cancel - Cancel button
<div data-role="wizard-classic"
data-cls-page="d-flex flex-center"
data-on-help="alert('Help Pressed!')"
data-on-cancel="alert('Cancel Pressed!')"
data-on-finish="alert('Finish Pressed!')"
data-icon-help="<span class='mif-help'>">
<div class="page">Page 1</div>
<div class="page">Page 2</div>
<div class="page">Page 3</div>
<div class="page">Page 4</div>
</div>