Introduction
Similar to tabs, you may want to use a multistep wizard to reduce the number of components that are visible at once. These are especially useful if your form has a definite chronological order, in which you want each step to be validated as the user progresses.Rendering a submit button on the last step
You may use thesubmitAction() method to render submit button HTML or a view at the end of the wizard, on the last step. This provides a clearer UX than displaying a submit button below the wizard at all times:
Setting a step icon
Steps may have an icon, which you can set using theicon() method:
Customizing the icon for completed steps
You may customize the icon of a completed step using thecompletedIcon() method:
Adding descriptions to steps
You may add a short description after the title of each step using thedescription() method:
Setting the default active step
You may use thestartOnStep() method to load a specific step in the wizard:
Allowing steps to be skipped
If you’d like to allow free navigation, so all steps are skippable, use theskippable() method:
skippable() method accepts a boolean value to control if the steps are skippable or not:
Deferring the loading of step content
If the content of a wizard step is expensive to render, you can pass aSchema object to its schema() method and use deferLoading(). The content of the active step will be loaded when it enters the viewport. The content of a later step will not be loaded until the user reaches it:
Wizard component namespaces them from other steps in the same schema. You can learn more in the schema overview.
Persisting the current step in the URL’s query string
By default, the current step is not persisted in the URL’s query string. You can change this behavior using thepersistStepInQueryString() method:
step key. You can change this key by passing it to the persistStepInQueryString() method:
Step lifecycle hooks
You may use theafterValidation() and beforeValidation() methods to run code before and after validation occurs on the step:
Preventing the next step from being loaded
InsideafterValidation() or beforeValidation(), you may throw Filament\Support\Exceptions\Halt, which will prevent the wizard from loading the next step:
Using grid columns within a step
You may use thecolumns() method to customize the grid within the step:
Customizing the wizard action objects
This component uses action objects for easy customization of buttons within it. You can customize these buttons by passing a function to an action registration method. The function has access to the$action object, which you can use to customize it. The following methods are available to customize the actions:
nextAction()previousAction()