A three-step "Create a project" wizard inside a Bootstrap 6 Dialog. It combines the new Stepper, a progress bar, Back/Next buttons, per-step validation, a Chips input for team invites and a review screen. Use it for onboarding, creating projects or workspaces, or any task that is easier in small steps.
How it works
The root .mwd-root shows a project list and a "New project" button that opens <dialog class="dialog dialog-lg mwd-dialog"> through data-bs-toggle="dialog". Under the header, a slim .progress bar sits above the body. The body contains ol.stepper.stepper-horizontal and a form with three fieldset.mwd-step blocks marked data-mwd-step 1–3:
- Details: a required project name, a template
<select>and two radio cards (form-field-card) for visibility. - Team: a Bootstrap 6 Chips input (
.chip-inputwithdata-bs-chips) for invite emails, plus a default role. - Review: a
dl.mwd-summarythat the script fills fromFormData, and a checkbox for sample tasks.
script.js keeps the current step index. render() shows the right fieldset, marks stepper items .active (and .mwd-complete, which shows a check mark), sets aria-current="step", updates the progress bar width and aria-valuenow, and changes the Next label to "Create project" on the last step. validate() checks [required] fields in the current step and adds .is-invalid. On the last step a simulated request adds the new project to .mwd-projects and shows .mwd-done. Closing after that resets the wizard.
Customization
--mwd-accenton.mwd-root: the emerald brand color. It also sets--bs-primary-bg,--bs-stepper-active-bgand--bs-control-checked-bg.- To add a step, add a
fieldset.mwd-stepand a matchingli.stepper-item.totalis counted automatically. - Add
requiredto any field in a step to block Next until it is valid. --bs-dialog-widthon.mwd-dialog: the wizard width (38rem)..mwd-stepper .stepper-item.mwd-complete::before: change thecontentto use a different symbol for finished steps.- Replace the
setTimeoutinfinish()withfetch('/api/projects', …). - Remove
data-mwd-autoopenso the wizard no longer opens on load (the attribute is there for the preview).
Use cases
- Onboarding flows: new users complete a three-step Create a project wizard with a progress bar
- Workspace setup: each step is validated before the Next button moves forward
- Team invites: a chips input collects several email addresses in one field
- Project creation: a final review screen summarizes the choices before confirming
Accessibility
"Step 2 of 3" is an aria-live region, and the progress bar has role="progressbar" with aria-valuenow. The current stepper item has aria-current="step". After each step change, focus moves to the first field of the new step, and to the success heading at the end. Invalid fields get aria-invalid and visible messages. Pressing Enter in a field moves to the next step. The progress animation is disabled under prefers-reduced-motion.
Bootstrap 6 notes
This is built on Bootstrap 6.0.0-alpha.1, and alpha APIs can still change. The BS5 modal becomes <dialog class="dialog dialog-lg">. Wizard steps use the new CSS-only stepper instead of custom markup. Tag inputs use the new Chips component, which needs no init code. form-check radios become .radio inside form-field-card, and form-select is form-control.