Steppers convey progress through numbered steps. It provides a wizard-like workflow.
Steppers display progress through a sequence of logical and numbered steps. They may also be used for navigation. Steppers may display a transient feedback message after a step is saved. The stepper supports storing input data in the stepper context. It supports the following controls.
The $Body variable will contain a JSON string that contains the current state of the stepper. You will receive information about the fields that have been defined within the stepper and info about the current step that has been completed. The $Body JSON string will have the following format.
You can validate a step in a stepper by specifying the OnValidateStep parameter. The script block will receive a $Body variable with JSON that provides information about the current state of the stepper. You will need to return a validation result using New-UDValidationResult to specify whether the current step state is valid.
The JSON payload will have the following format. Note that steps are 0 indexed. If you want to validate the first step, check to make sure the step is 0.
{ context: { field1:"value1" }, currentStep:0}
You will have to convert the JSON string to an object to work with in PowerShell and then return the validation result.
You can direct the user to a particular step in the OnValidateStep event handler. Use the New-UDValidationResult-ActiveStep parameter to move the user to any step after clicking next. Step indices are 0 based.
This example moves the user to the last step after completing the first step.
Tabs make it easy to explore and switch between different views.
Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
Tabs
Vertical Tabs
Dynamic Tabs
Dynamic tabs will refresh their content when they are selected. You will need to include the -RenderOnActive parameter to prevent all the tabs from rendering even if they are not shown.
Icons
API
Menu
New-UDMenu component for Universal Dashboard.
Available in PowerShell Universal 2.5 or later.
The menu component can be used to provide a drop down list of options for the user to select.
Basic Menu
Create a basic menu.
Button Styles
You can edit the style of the menu by adjusting the variant parameter.
Values
You can use the value parameter to define a value that differs from the text displayed.
OnChange Event Handler
Use the -OnChange parameter to specify a script block to call when a new value is selected. The value of the selected item will be available in $EventData.
API
Drawer
Drawer component for Universal Dashboard
Permanent Drawer
A permanent drawer will be shown at all times. By default, it is show on the left side of the screen.