A multi step form allows you to divide a form into multiple steps only showing a few questions at a time. This method allows for a better user experience and conversion on long forms.
Create a multi step form by following these two steps:
multistep
to the form tag<form-step>...</form-step>
.There are two ways to add a header to each formstep:
Add a heading="..."
attribute to the <form-step>
tag with the formstep title as the value. This works well for simple headings that include only text. This attribute is not required and does not have to be unique.
If you need a more custom header with icons or images then create one inside a <div slot="heading"></div>
.
The formstep will have a footer with the “previous” and “next” buttons. You can customize these buttons with the classes that are given to them.
.kw-multistep-button .kw-multistep-button-previous
.kw-multistep-button .kw-multistep-button-next
.kw-multistep-button .kw-multistep-button-submit
You can style and customize a multi step form using the following classes.
.kw-multistep
.kw-form-step
.kw-multistep-header
.kw-multistep-body
.kw-multistep-footer
Here is the default css stylings that can be overridden.
.kw-multistep-header {
padding: 15px;
background-color: #f5f5f5;
font-size: 24px;
}
.kw-multistep-body {
padding: 15px;
}
.kw-multistep-footer {
padding: 15px;
background-color: #f5f5f5;
}
.kw-multistep-footer .kw-multistep-button-previous {
float: left;
}
.kw-multistep-footer .kw-multistep-button-next,
.kw-multistep-footer .kw-multistep-button-submit {
float: right;
}