Tab component for Universal Dashboard
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.
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.
New-UDTabs
New-UDTab
Stepper component for Universal Dashboard
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.
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.
You can disable the previous button by using the -DisablePrevious
parameter of New-UDValidationResult
.
This example disables the previous step whenever the user moves forward in the stepper.
You can create a vertical stepper by setting the -Orientation
parameter to vertical.
New-UDStepper
New-UDStep
Name
Type
Description
Required
Tabs
ScriptBlock
The tabs to put within this container.
true
Id
String
The ID of the component. It defaults to a random GUID.
false
RenderOnActive
SwitchParameter
Whether to render the tabs when they are clicked. Is this value isn't present, all the tabs are rendered, even if they are not shown.
false
Orientation
String
The orientation of the tabs.
false
Name
Type
Description
Required
Text
string
The text to display in the header.
false
Content
scriptblock
The content of the tab.
true
Id
string
The ID of the tab.
false
Dynamic
switch
A dynamic tab will reload every time it is selected.
false
Icon
Object
false
Stacked
switch
false
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
ActiveStep
Int32
Sets the active step. This should be the index of the step.
false
Steps
ScriptBlock
The steps for this stepper. Use New-UDStep to create new steps.
true
NonLinear
SwitchParameter
Allows the user to progress to steps out of order.
false
AlternativeLabel
SwitchParameter
Places the step label under the step number.
false
OnFinish
Endpoint
A script block that is executed when the stepper is finished.
true
OnValidateStep
Endpoint
A script block that is executed when validating each step.
false
Orientation
string
Vertical or Horizontal
false
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
OnLoad
Endpoint
The script block that is executed when the step is loaded. The script block will receive the $Body parameter which contains JSON for the current state of the stepper. If you are using form controls, their data will be availalble in the $Body.Context property.
true
Label
String
A label for this step.
false
Optional
SwitchParameter
Whether this step is optional.
false