Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Input controls for Universal Dashboard
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Define static HTML using Universal Dashboard.
You can define static HTML using New-UDHtml
. This cmdlet does not create React components but rather allows you to define static HTML. Any valid HTML string is supported.
The following creates an unordered list.
New-UDHtml
Write raw HTML to your dashboard.
Name
Type
Description
Required
Markup
string
The HTML to display.
True
Information about UDElements.
The New-UDElement
cmdlet allows you to create custom React elements within your dashboard. Similar to New-UDHtml
, you can define HTML elements using New-UDElement
. Unlike, New-UDHtml
, you can update elements, set auto refresh and take advantage of the React component system.
You need to specify the -Tag
and -Content
when creating an element. The below example creates a div tag.
You can nest components within each other to create HTML structures. For example, you could create an unordered list with the following example.
You can select attributes of an element (like HTML attributes) by using the -Attributes
parameter. This parameter accepts a hashtable of attribute name and values. The below example creates red text.
You can define the -AutoRefresh
, -RefreshInterval
and -Endpoint
parameters to create an element the refreshes on a certain interval. The below example creates an element that refreshes every second and displays the current time.
You can use the Set-UDElement
cmdlet to set element properties and content dynamically. The following example sets the content of the element to the current time.
You can also set attributes by using the -Properties
parameter of Set-UDElement
. The following example sets the current time and changes the color to red.
You can add child elements using Add-UDElement
. The following example adds child list items to an unordered list.
You can clear the child elements of an element by using Clear-UDElement
. The following example clears all the list items from an unordered list.
You can force an element to reload using Sync-UDElement
. The following example causes the div to reload with the current date.
You can remove an element by using Remove-UDElement
.
Get-UDElement
Get component state.
Name
Type
Description
Required
Id
string
The ID of the component to receive.
true
Set-UDElement
Set component state.
Name
Type
Description
Required
Id
string
The ID of the component to set.
true
Properties
Hashtable
Properties to set on the component
false
Broadcast
Switch
Set the properties of a component for all users.
false
Content
ScriptBlock
The content of the component to set.
false
Remove-UDElement
Remove a component.
Name
Type
Description
Required
Id
string
The ID of the component to remove.
true
Add-UDElement
Add a child component.
Name
Type
Description
Required
ParentId
string
The ID of the component to add a child to.
true
Content
ScriptBlock
The child content to add.
true
Broadcast
Switch
Whether to add the child component to all users.
false
Clear-UDElement
Clear child components out of a component.
Name
Type
Description
Required
Id
string
The ID of the component to clear.
true
Sync-UDElement
Reload a component
Name
Type
Description
Required
Id
string
The ID of the component to reload.
true
Broadcast
Switch
Whether to reload the component for all users.
false
Select-UDElement
Select a component.
Name
Type
Description
Required
Id
string
The ID of the element to select
true
ScrollToElement
Switch
Whether to scroll the user's window to the element
false
Information about Universal Dashboard pages.
A dashboard can consist of one or more pages. A page can have a particular name and URL. You can define a URL that accepts one or more variables in the URL to define a dynamic page.
A basic page can be defined using the New-UDPage
cmdlet. You could navigate to this page by visiting the /dashboard
URL of your dashboard.
Dashboards can have multiple pages and those pages can be defined by passing an array of UDPages to New-UDDashboard
You may want to organize your dashboard into multiple PS1 files. You can do this using pages.
A page can have a custom URL by using the -Url
parameter. You could navigate to this page by visiting the /db
URL of your dashboard.
You can define a page with variables in the URL to create pages that adapt based on that URL.
Query string parameters are passed to pages and other endpoints as variables.
For example, if you visited a page with the following query string parameter: http://localhost:5000/dashboard/Page1?test=123
You would then have access to a $Test
variable that contained the value 123
.
This feature requires a license.
You can prevent users from accessing pages based on their role by using the -Role
parameter of pages. You can configure roles and role policies on the Security page.
You can customize the navigation of a page using the -Navigation
and -NavigationLayout
parameters. Navigation is defined using the List component. Navigation layouts are either permanent or temporary.
Custom navigation can be defined with a list. List items can include children to create drop down sections in the navigation.
Dynamic navigation can be used to execute scripts during page load to determine which navigation components to show based on variables like the user, IP address or roles.
You can generate dynamic navigation by using the -LoadNavigation
parameter. The value of the parameter should be a script block to execute when loading the navigation.
The permanent layout creates a static navigation drawer on the left hand side of the page. It cannot be hidden by the user.
The temporary layout creates a navigation drawer that can be opened using a hamburger menu found in the top left corner. This is the default setting.
You can display a logo in the navigation bar by using the -Logo
parameter.
First, setup a published folder to host your logo.
Now, when creating your page, you can specify the path to the logo.
The logo will display in the top left corner.
To customize the style of your logo, you can use a cascading style sheet and target the ud-logo
element ID.
Creates a new page. Pass the results to New-UDDashboard
-Pages
Name
Type
Description
Required
Name
string
The name of the page.
true
Content
ScriptBlock
The content of the page.
true
Url
string
The URL for the page. Name is used if no URL is specified.
false
DefaultHomePage
Switch
The page is the default home page.
false
Title
string
The title to display at the top of the page
false
Blank
Switch
Creates a page that has no toolbar.
false
Id
string
The ID for the page. This needs to be unique.
false
OnLoading
ScriptBlock
Return a component to show when the page is loading
false
Role
string[]
Roles that have access to this page.
false
NavigationLayout
string
Whether to popup or pin navigation.
false
Navigation
Hashtable[]
A collection of UDListItems to display for navigation
false
Logo
string
The URL to a logo to display in the toolbar.
false
LoadNavigation
ScriptBlock
Dynamically load navigation when the user loads the page.
false
A Universal Dashboard website is composed of components. There are two frameworks that provide a set of core components that you can use within your pages. In addition to the core component, you can also extend Universal Dashboard with a large set of community created components.
There are two non-framework components that are built in to PSU. These include the Nivo charts library as well as the UDMap component. They will work in either framework. Additional components can be downloaded from the UD Marketplace.
External components are distributed as PowerShell modules and can be used in a dashboard by using Import-Module
.
When building a dashboard, you can simply call the PowerShell cmdlets within your dashboard script to create a new component.
Some components are not included automatically. You can add component modules by clicking the Components button on the Dashboard page and then adding the components. This list will also include components downloaded from the Marketplace.
Dynamic regions allow you control the reload of data within the region.
New-UDDynamic
allows you to define a dynamic region. Pages themselves are dynamic in nature. This means that every time a page is loaded, it runs the PowerShell for that page. Sometimes, you may want to reload a section of a page rather than the whole page itself. This is when you will want to use dynamic regions.
This dynamic region reloads when the button is clicked.
Dynamic regions enable the ability to auto refresh components after a certain amount of time. The entire region's script block will be run when autorefreshing.
If you have multiple related components that use the same data, consider putting them in the same dynamic region to improve performance.
Sometimes refreshing a dynamic component may take some time. For example, if you are querying another service's REST API or a data. Dynamic regions support configuration of the component that shows when the region is reloading. By default, nothing is shown. This can be any Universal Dashboard component.
Defines a dynamic region on a page.
Name
Type
Description
Required
Id
string
Unique identifier for this region
false
ArgumentList
object[]
Arguments to pass to the region. Available within the -Content by using $ArgumentList
false
Content
ScriptBlock
The content to load within the dynamic region
true
AutoRefresh
Switch
Whether this dynamic region will refresh on an interval
false
AutoRefreshInterval
int
The number of seconds between auto refreshes.
false
LoadingComponent
ScriptBlock
A component to display when the dynamic is loading
false
Error boundary component for Universal Dashboard.
The New-UDErrorBoundary
component is used for isolating portions of a dashboard to contain components that may throw an error. Many Universal Dashboard components use the error boundary component internally.
If you'd like to isolate a portion of your dashboard to prevent the entire page from failing to load, you can use the following syntax.
If any error is thrown from the content, you will see an error such as thing.
New-UDErrorBoundary
Display an error card when an error is thrown in your script.
Name
Type
Description
Required
Content
ScriptBlock
A script block to prevent from throwing an error to the top of the page.
True
This document outlines how to build custom Universal Dashboard components.
Universal Dashboard is extensible and you can build custom JavaScript components and frameworks. This document will cover how to build custom components that integrate with the Universal Dashboard platform.
This is an advanced topic and not required if you simply want to use Universal Dashboard. There are a lot of existing custom components available on the Universal Dashboard Marketplace.
Look at our blog post on how to get started with custom components for full end-to-end example.
Below is a list of some of the technologies used when building Universal Dashboard components. You will not need to be an expert to produce a component but should be aware of what to search when you encounter a problem.
Universal Dashboard's client-side application is built using the React framework. React makes it easy to build components that update the DOM only when necessary and has a pretty robust ecosystem of users. It's one of the most popular JavaScript frameworks at the time of this writing.
Babel is a transcompiler for JavaScript. It works well with React and allows you to use modern constructs while compiling for backwards compatibility of browsers. Universal Dashboard uses Babel for it's core component frameworks.
Webpack is an asset bundler. It's extremely customizable and is responsible for turning your JSX files into a bundle that can then be distributed with Universal Dashboard components.
There are some basic parts to a Universal Dashboard component. You will need to understand the structure in order to successfully build your own.
Universal Dashboard custom components are PowerShell modules. They export functions that can be used to create the component when run within a dashboard. The PowerShell module is also responsible for registering the JavaScript assets with Universal Dashboard.
The JavaScript bundle is produced by the Webpack bundling process. It consists of one or more JS files that you will need to register with UD.
The most basic structure for a UD component module will include a single JavaScript file, a PSM1 file to export a function and register the JavaScript and a PSD1 module manifest.
This following section will take you step-by-step through the different aspects of building a UD component. This assumes you are running PowerShell Universal 1.2 or later and using the PowerShell Universal Dashboard v3 framework.
For a full example of a component, click here.
You will need to install the following dependencies before creating your component.
After installing Node, you will have access to the npm
command. You will need to initialize the node package to start. This will create a package.json
file in your directory.
Here is an example package.json
that you can also use as a starting point.
You will need several JavaScript packages to build your bundle. You will first want to install the dev dependencies. These are used to build your project.
Next, you'll want to install the universal-dashboard
package along with any other packages you wish to use in your component. We are using React95 in this example. We will build a control based on that library.
You will need to create a .babelrc
file to configure Babel for React.
Webpack is extremely customizable and sometimes very hard to get right. Below is a basic webpack.config.js
file you can use to configure Webpack. You can safely change the ud95
entry key name and library value to one that matches your library.
Now you can build your first component. You will need to export a single function component from your component.jsx file. We suggest the use of functional React components rather than class-based React components. We need to wrap the component in withComponentFeatures to ensure the component has access to the Universal Dashboard platform features.
Once your component is completed, you'll need to add it to an index
.js file. The entry point for your library is the first place Webpack will look. It will discover all other components from import statements in your code. The index.js file is where you should register your components. You can use the registerComponent
function to do so.
To bundle the JavaScript, run the following command to start webpack. This will output a file into the dist folder.
Now you will need to create a PowerShell script that registers and creates your component.
First, register the JavaScript with Universal Dashboard.
Next, create a function that returns a hashtable that defines which component we are creating and which props to set.
The type
property of your hashtable needs to match with the first parameter of registerComponent
that you called in your JavaScript.
We suggest the use of InvokeBuild to create a build script to run all the steps of packaging and staging your module. The below build script deletes the dist folder, runs an NPM install to install packages, runs an NPM build to bundle the JavaScript and then copies the PS module to the dist folder.
Props are values that are either passed from the PowerShell hashtable provided by the user or by the Universal Dashboard withComponentsFeature
high-order function.
The properties that you set in your hashtable in PowerShell will automatically be sent in as props to React component.
For example, if you set the text
property of the hashtable like this.
Then you will have access to that prop in React.
Endpoints are special in the way they are registered and the way that they are passed as props to your component. You will need to call Register
on the endpoint in PowerShell and pass in the Id and PSCmdlet variables.
Endpoints are created from ScriptBlocks and are executed when that event happens.
Universal Dashboard will automatically wire up the endpoint to a function within JavaScript. This means that you can use the props to call that endpoint.
Notice the props.onClick
function call. This will automatically call the PowerShell script block on the server.
The setState
prop is used to set the state of the component. This ensures that the state is tracked and your component will work with Get-UDElement
.
For example, with a text field, you'll want to call props.setState
and pass in the new text value for the state.
The children
prop is a standard React prop. If your component supports child items, such as a list or select box, you should use the standard props.children
prop to ensure that the cmdlets Add-UDElement
, Remove-UDElement
and Clear-UDElement
function correctly.
The Universal Dashboard Marketplace is an aggregator of the PowerShell Gallery that lists Universal Dashboard components. The UD Marketplace automatically hooks into PowerShell Universal v1.3 or later where you can easily install additional components.
To publish to the Marketplace, you simply need to publish to the PowerShell Gallery but include the ud-component
tag in your module manifest. The marketplace syncs with the Gallery every hour and your component will be enabled for anyone to find after that.
Icon component for Universal Dashboard
FontAwesome icons to include in your dashboard.
Create icons by specifying their names. You can use the icon reference below to find icons.
Set the size of the icon. Valid values are: xs
, sm
, lg
, 2x
, 3x
, 4x
, 5x
, 6x
, 7x
, 8x
, 9x
, 10x
Rotate icons. The value represents the degrees of rotation.
Add a border to your icon.
Apply CSS styles to your icon.
New-UDIcon
Name
Type
Description
Required
Id
string
Id of the icon
false
Icon
FontAwesomeIcons
Icon to select
false
FixedWidth
switch
false
Inverse
switch
Whether to inverse the icon
false
Rotation
int
Rotates an icon clockwise based on the degrees specified
false
ClassName
string
false
Transform
string
false
Flip
string
false
Pull
string
false
ListItem
switch
false
Spin
switch
Caues the icon to spin.
false
Border
switch
Adds a border to the icon.
false
Pulse
switch
false
Size
string
The size of the icon
false
Style
hashtable
A CSS style to apply to the icon.
false
Title
string
false
Regular
switch
false
Color
Alert component for Universal Dashboard.
Alerts provide a simple way to communicate information to a user.
Alerts have four different severities and can include text or other content.
Alerts can contain any component and also a title.
New-UDAlert
Name
Type
Description
Required
Id
string
The ID of this component.
False
Severity
string
The type of alert to display.
False
Content
ScriptBlock
Custom alert content to display.
False
Text
string
Text to display within the alert.
False
Title
string
The title of the alert.
False
Table component for Universal Dashboard
Tables display sets of data. They can be fully customized.
Tables display information in a way that’s easy to scan, so that users can look for patterns and insights. They can be embedded in primary content, such as cards.
A simple example with no frills. Table columns are defined from the data.
Define custom columns for your table.
Define column rendering. Sorting and exporting still work for the table.
Column width can be defined using the -Width
parameter. You can also decide to truncate columns that extend past that width.
You can configure custom filters per column. The table supports text
, select
, fuzzy
, slider
, range
, date
, number
, and autocomplete
filters.
For a full example of server-side processing, see this blog post.
Process data on the server so you can perform paging, filtering, sorting and searching in systems like SQL.
By default, paging is disable and tables will grow based on how many rows of data you provide. You can enable paging by using the -ShowPagination
cmdlet (alias -Paging
). You can configure the page size using the -PageSize
cmdlet.
By default, the page size selector provides an option to show all rows. If you want to prevent users from doing this, use the -DisablePageSizeAll
cmdlet.
To enable sorting for a table, use the -ShowSort
parameter. When you enable sorting, you will be able to click the table headers to sort the table by clicking the headers. By default, multi-sort is enabled. To multi-hold shift and click a column header.
You can control which columns can be sorted by using New-UDTableColumn
and -ShowSort
parameter.
This documentation is for a feature that will be available in a future version of PowerShell Universal.
By default, the sorting of a table has 3 states. Unsorted, ascending and descending. If you would like to disable the unsorted state, use the -DisableSortRemove
parameter of New-UDTable
.
Tables support selection of rows. You can create an event handler for the OnRowSelected
parameter to receive when a new row is selected or unselected or you can use Get-UDElement
to retrieve the current set of selected rows.
The following example creates a table with row selection enabled. A toast is show when clicking the row or when clicking the GET Rows button.
The $EventData
variable for the -OnRowSelected
event will include all the columns as properties and a selected property as to whether the row was selected or unselected.
For example, the service table data would look like this.
Tables support exporting the data within the table. You can export as CSV, XLSX, JSON or PDF. You can define which columns to include in an export and choose to export just the current page or all the data within the table.
You can control the export functionality with a PowerShell script block. This is useful when exporting from server-side sources like SQL server tables.
In this example, I have a SQL table that contains podcasts. When exporting, you will receive information about the current state of the table to allow you to customize what data is exported.
You can decide which export options to present to your users using the -ExportOption
cmdlet. The following example would only show the CSV export option.
You can use the -TextOption
parameter along with the New-UDTableTextOption
cmdlet to set text fields within the table.
You can externally refresh a table by putting the table within a dynamic region and using Sync-UDElement
.
This example creates a button to refresh the table.
Creates a new table.
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Title
String
The title to show at the top of the table's card.
false
Data
Object[]
The data to put into the table.
true
LoadData
Endpoint
When using dynamic tables, this script block is called. The $Body parameter will contain a hashtable the following options: filters: @() orderBy: string orderDirection: string page: int pageSize: int properties: @() search: string totalCount: int You can use these values to perform server-side processing, like SQL queries, to improve the performance of large grids. After processing the data with these values, output the data via Out-UDTableData.
true
Columns
Hashtable[]
Defines the columns to show within the table. Use New-UDTableColumn to define these columns. If this parameter isn't specified, the properties of the data that you pass in will become the columns.
false
Sort
SwitchParameter
Whether sorting is enabled in the table.
false
Filter
SwitchParameter
Whether filtering is enabled in the table.
false
Search
SwitchParameter
Whether search is enabled in the table.
false
Export
SwitchParameter
Whether exporting is enabled within the table.
false
Paging
SwitchParameter
Whether to enable paging.
false
PageSize
int
Number of items to show in a page by default. Defaults to 5.
false
PageSizeOptions
int[]
Page size options to show in the selector. Defaults to @(5, 10, 20)
false
Dense
SwitchParameter
Enables dense padding.
false
DefaultSortDirection
string
Sets the default sort direction for the table.
false
HideToggleAllRowsSelected
SwitchParameter
Disables the toggle all rows when using selection
false
DisableMultiSelect
SwitchParameter
Disables multiple selections
false
DisablePageSizeAll
SwitchParameter
Disables the ability to show all records in a paged table.
false
Defines column properties for a table.
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Property
String
The property to select from the data for this column
true
Title
String
The title to display at the top of the column. Property name is used if not specified.
false
Render
ScriptBlock
A script block that is called when rendering this column. The $_ variable will contain the current row. Return any control from this scriptblock.
false
ShowSort
Switch
Include this column in sorting.
false
ShowFilter
Switch
Include a filter for this column.
false
FilterType
string
The type of filter to display. text, select, fuzzy, slider, range, date, number, autocomplete
false
Style
Hashtable
A CSS style applied to the column
false
Width
int
The width of the column in pixels
false
IncludeInSearch
Switch
Whether to include this column when searching.
false
IncludeInExport
Switch
Whether to include this column when exporting.
false
DefaultSortColumn
Switch
This column defines the default sorting when the table is loaded.
false
Align
string
The alignment of the data in the table.
false
Truncate
Switch
Whether to truncate the text in the column if it is longer than -Width
false
SortType
string
How to sort the data within the column
false
Returns data from the -LoadData
parameter of New-UDTable
.
Name
Type
Description
Required
Data
object
The data to display in the table
true
Page
int
The current page.
true
TotalCount
int
The total count of rows in the entire data set. This is not just what is passed to data.
true
Properties
string[]
Properties included in the data. Use $EventData.Properties.
true
Allows for custom text in the table controls.
Name
Type
Description
Required
ExportAllCsv
string
Export all as CSV text
false
ExportCurrentViewCsv
string
Export Current View as CSV text
false
ExportAllXLSX
string
Export all as XLSX text
false
ExportCurrentViewXLSX
string
Export Current View as XLSX text
false
ExportAllPDF
string
Export all as PDF text
false
ExportCurrentViewPDF
string
Export Current View as PDF text
false
ExportAllJson
string
Export all as JSON text
false
ExportCurrentViewJson
string
Export Current View as JSON text
false
ExportFileName
string
File Name text
false
Search
string
Search {0} records... text
false
FilterSearch
string
Search {0} records... text
false
Backdrop component for Universal Dashboard.
This component will be available in a future version of Universal Dashboard.
The backdrop component places an overlay over the drop of the entire page. It's useful for displaying loading states.
To create a basic backdrop, you can use the New-UDBackdrop
cmdlet and include content to show within the backdrop. The content will be centered on the page. To show the backdrop, use the -Open
switch parameter.
The backdrop provides an -OnClick
handler that you can use to close the backdrop when clicked. You can use Set-UDElement
to open and close the backdrop.
Map component for Universal Dashboard.
To use maps within your dashboard, you will need to add the UniversalDashboard.Map component.
The UDMap component is a robust control that provides a huge set of features. You can select base layers, configure togglable layers, set markers, define vectors and interact with other Universal Dashboard components.
This basic map defines a simple base layer using the wmflabs.org tile server. You can use your own custom tile server by specifying a URL. The map is position over Hailey, Idaho.
You can enable the layer control by using the New-UDMapLayerControl
cmdlet. This map defines several layers with components that you can toggle on and off. You can only have one base layer selected as a time. Map overlay layers can toggle on and off.
Heatmaps can be defined by creating a heatmap layer. The intesity and location of the heatmap clusters can be defined by using the New-UDMapHeatmapLayer
cmdlet.
Marker clusters group together markers that are close to each other. As you zoom in or out, the clusters will either combine or explode.
Maps provide a series of interactive capabilities for add components to and manipulating the map.
Check component for Universal Dashboard
Checkboxes allow the user to select one or more items from a set.
Checkboxes can be disabled and checked by default
Create checkboxes that use any icon and style.
Create checkboxes that fire script blocks when changed.
You can adjust where the label for the checkbox is placed.
You can use Get-UDElement
to get the value of the checkbox. Get-UDElement
will also return other properties of the checkbox component.
The following example shows a toast message with the value of the checkbox.
New-UDCheckbox
Name
Type
Description
Required
Label
String
The label to show next to the checkbox.
false
Icon
Object
The icon to show instead of the default icon.
false
CheckedIcon
Object
The icon to show instead of the default checked icon.
false
OnChange
Endpoint
Called when the value of the checkbox changes. The $EventData variable will have the current value of the checkbox.
false
Style
Hashtable
A hashtable of styles to apply to the checkbox.
false
Disabled
SwitchParameter
Whether the checkbox is disabled.
false
Checked
Boolean
Whether the checkbox is checked.
false
ClassName
String
A CSS class to assign to the checkbox.
false
LabelPlacement
String
Where to place the label.
false
Id
String
The ID of the component. It defaults to a random GUID.
false
Progress component for Universal Dashboard
New-UDProgress
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
PercentComplete
Object
The percent complete for the progress.
false
BackgroundColor
DashboardColor
The background color.
false
ProgressColor
DashboardColor
The progress bar color.
false
Circular
SwitchParameter
Whether the progress is circular.
false
Color
String
The color of the progress.
false
Size
String
The size of the progress.
false
A skeleton component for PowerShell Universal Dashboard.
A skeleton is a form of a loading component that can show a placeholder while data is received.
There are three variants that you can use for a skeleton. You can use a circle, text or a rectangle. You can also define the height and width of the skeleton.
Skeletons will use the pulsate animation by default. You can also disable animation or use a wave animation.
Modal component for Universal Dashboard.
Modals inform users about a task and can contain critical information, require decisions, or involve multiple tasks.
Full width modals take up the full width as defined by the -MaxWidth
parameter.
Persistent modals do not close when you click off of them. You will have to close it with Hide-UDModal
.
You can use the Hide-UDModal
button to hide a modal that is currently show.
Show-UDModal
Name
Type
Description
Required
FullScreen
switch
Creates a full screen modal
false
Footer
ScriptBlock
Sets the footer content for the modal.
false
Header
ScriptBlock
Sets the header content for the modal.
false
Content
ScriptBlock
Sets the main body content for the modal.
false
Persistent
switch
Creates a persistent modal.
false
FullWidth
switch
Creates a full width modal.
false
MaxWidth
string
Defines the max width of a full width modal.
false
Button component for Universal Dashboard
Buttons allow users to take actions, and make choices, with a single tap.
Contained buttons are high-emphasis, distinguished by their use of elevation and fill. They contain actions that are primary to your app.
Outlined buttons are medium-emphasis buttons. They contain actions that are important, but aren’t the primary action in an app.
You can control the pixel size of a button based on pixel size by using the Style parameter
'''text New-UDButton -Id "Submit" -Text "Submit" -Style @{ Width = "150px" Height = "100px" }
Sometimes you might want to have icons for certain button to enhance the UX of the application as we recognize logos more easily than plain text. For example, if you have a delete button you can label it with a dustbin icon.
You can specify a script block to execute when the button is clicked
New-UDButton
Name
Type
Description
Required
Text
String
The text to show within the button.
false
Icon
Object
An icon to show within the button. Use New-UDIcon to create an icon for this parameter.
false
Variant
String
The variant type for this button.
false
IconAlignment
String
How to align the icon within the button.
false
FullWidth
SwitchParameter
Whether the button takes the full width of the it's container.
false
OnClick
Endpoint
The action to take when the button is clicked.
false
Size
String
The size of the button.
false
Style
Hashtable
Styles to apply to the button.
false
Href
String
A URL that the user should be redirected to when clicking the button.
false
Id
String
The ID of the component. It defaults to a random GUID.
false
Code editor component for Universal Dashboard.
To use a code editor within your dashboard, you will need to add the UniversalDashboard.CodeEditor component.
The code editor component allows you to host the Microsoft Monaco editor within your dashboards.
You can create a new code editor with the New-UDCodeEditor
cmdlet. Specifying the -Language
parameter will enable syntax highlighting for that language. You will need to specify a height in pixels.
Use the -Code
parameter to specify code that will be populated within the code editor when it loads.
You can retrieve code from another component using the Get-UDElement
cmdlet and accessing the code property of the hashtable that is returned.
You can set code from another component using the Set-UDElement
cmdlet. Specify the code value in a hashtable passed to the -Properties
parameter.
The documentation is for an upcoming feature of PowerShell Universal .
The Monaco editor supports a wide range of options. If you wish to use options that aren't available on the New-UDCodeEditor
cmdlet, you can use the -Options
parameter and pass a hashtable of options instead.
For a full list of options, check the IEditorConsturctionOptions interface.
Floating action button component for Universal Dashboard
A floating action button (FAB) performs the primary, or most common, action on a screen.
A floating action button appears in front of all screen content, typically as a circular shape with an icon in its center. FABs come in two types: regular, and extended.
Only use a FAB if it is the most suitable way to present a screen’s primary action.
Only one floating action button is recommended per screen to represent the most common action.
New-UDFloatingActionButton
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Icon
Object
The icon to put within the floating action button.
false
Size
Object
The size of the button.
false
OnClick
Object
A script block to execute when the floating action button is clicked.
false
Charting components for Universal Dashboard.
Universal Dashboard provides several built-in charting solutions to help visualize your data retrieved from PowerShell.
To use charts within your dashboard, you will need to add the UniversalDashboard.Charts component.
Universal Dashboard integrates with ChartJS.
To create a chart, use New-UDChartJS
and New-UDChartJSData
. The below chart shows the top ten CPU using processes.
Colors can be defined using the various color parameters of New-UDChartJS
.
By default, you do not need to define data sets manually. A single data set is created automatically when you use the -DataProperty
and -LabelProperty
parameters. If you want to define multiple data sets for a single chart, you can use the -Dataset
property in conjunction with New-UDChartJSDataset
.
You can take action when a user clicks the chart. This example shows a toast with the contents of the $Body
variable. The $Body
variable contains a JSON string with information about the elements that were clicked.
You can use New-UDDynamic
to create charts that refresh on an interval.
Monitors are a special kind of chart that tracks data over time. Monitors are good for displaying data such as server performance stats that change frequently. You return a single value from a monitor and it is graphed automatically over time.
Universal Dashboard integrates with Nivo Charts. Below you will find examples and documentation for using these charts.
All the Nivo charts can be created with New-UDNivoChart
. You will specify a switch parameter for the different types of charts. Each chart type will take a well defined data format via the -Data
parameter.
Nivo provides the ability to specify patterns to display over data sets. You can configure these patterns with New-UDNivoPattern
and New-UDNivoFill
.
Nivo charts provide responsive widths so they will resize automatically when placed on a page or the browser is resized. A height is required when using responsive widths.
Like many components in Universal Dashboard v3, Nivo charts do not define auto-refresh properties themselves. Instead, you can take advantage of New-UDDynamic
to refresh the chart on an interval.
Nivo charts support OnClick event handlers. You will be provided with information about the data set that was clicked as JSON.
Form component for Universal Dashboard
Forms provide a way to collect data from users.
Forms can include any type of control you want. This allows you to customize the look and feel and use any input controls.
Data entered via the input controls will be sent back to the the OnSubmit
script block when the form is submitted. Within the OnSubmit
event handler, you will access to the $EventData
variable that will contain properties for each of the fields in the form.
For example, if you have two fields, you will have two properties on $EventData
.
The following input controls automatically integrate with a form. The values that are set within these controls will be sent during validation and in the OnSubmit
event handler.
Simple forms can use inputs like text boxes and checkboxes.
Since forms can use any component, you can use standard formatting components within the form.
When a form is submitted, you can optionally return another component to replace the form on the page. You can return any Universal Dashboard component. All you need to do is ensure that the component is written to the pipeline within the OnSubmit
event handler.
Form validation can be accomplished by using the OnValidate script block parameter
You can define an -OnCancel
event handler to invoke when the cancel button is pressed. This can be used to take actions like close a modal.
Although you can return components directly from a form, you may want to retain the form so users can input data again. To do so, you can use Set-UDElement
and a placeholder element that you can set the content to.
In this example, we have an empty form that, when submitted, will update the results
element with a UDCard.
New-UDForm
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Children
ScriptBlock
Controls that make up this form. This can be any combination of controls. Input controls will report their state to the form.
true
OnSubmit
Endpoint
A script block that is execute when the form is submitted. You can return controls from this script block and the form will be replaced by the script block. The $EventData variable will contain a hashtable of all the input fields and their values.
true
OnValidate
Endpoint
A script block that validates the form. Return the result of a call to New-UDFormValidationResult.
false
OnProcessing
ScriptBlock
A script block that is called when the form begins processing. The return value of this script block should be a component that displays a loading dialog. The script block will receive the current form data.
false
OnCancel
Endpoint
An endpoint that is called when this form is cancelled. When this parameter is defined a cancel button will appear.
false
New-UDFormValidationResult
Name
Type
Description
Required
Valid
SwitchParameter
Whether the form status is considered valid.
false
ValidationError
String
An error to display if the form is not valid.
false
Select component for Universal Dashboard
Select components are used for collecting user provided information from a list of options.
Create a simple select with multiple options.
Create a select with groups of selections.
Execute a PowerShell event handler when the value of the select is changed.
Retrieve the value of the select from another component.
New-UDSelect
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Option
ScriptBlock
Options to include in this select. This can be either New-UDSelectOption or New-UDSelectGroup.
false
Label
String
The label to show with the select.
false
OnChange
Endpoint
A script block that is executed when the script changes. $EventData will be an array of the selected values.
false
DefaultValue
String
The default selected value.
false
Disabled
SwitchParameter
Whether this select is disabled.
false
Multiple
SwitchParameter
Whether you can select multiple values.
false
Radio component for Universal Dashboard
Radio buttons allow the user to select one option from a set.
Use radio buttons when the user needs to see all available options. If available options can be collapsed, consider using a dropdown menu because it uses less space.
Radio buttons should have the most commonly used option selected by default.
An event handler that is called when the radio group is changed. the $Body variable will contain the current value.
Set the default value of the radio group.
You can use custom formatting within the radio group. The below example will place the radio buttons next to each other instead of on top of each other.
New-UDRadio
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Label
String
The label to show next to the radio.
false
Disabled
SwitchParameter
Whether the radio is disabled.
false
Value
String
The value of the radio.
false
LabelPlacement
String
The position to place the label in relation to the radio.
false
Textbox component for Universal Dashboard
A textbox lets users enter and edit text.
A password textbox will mask the input.
You can create a multiline textbox by using the -Multiline
parameter. Pressing enter will add a new line. You can define the number of rows and the max number of rows using -Rows
and -RowsMax
.
You can use Get-UDElement
to get the value of a textbox
You can set the icon of a textbox by using the -Icon
parameter and the New-UDIcon
cmdlet.
You can define a text mask with a combination of strings and regular expressions. To specify a regular expression, use the JavaScript syntax in your string to start and finish the expression: /\d/
.
This example creates a mask for US based phone numbers.
New-UDTextbox
Switch component for Universal Dashboard
Switches toggle the state of a single setting on or off.
Switches are the preferred way to adjust settings on mobile. The option that the switch controls, as well as the state it’s in, should be made clear from the corresponding inline label.
Create a basic switch.
Respond to when a switch value is changed. The $EventData
variable will include whether or not the switch was checked or unchecked.
You can retrieve the value of the switch within another component by using Get-UDElement
. Use the Checked property to determine whether the switch is checked out not.
New-UDSwitch
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Label
String
A label to show above this textbox.
false
Placeholder
String
A placeholder to place within the text box.
false
Value
Object
The current value of the textbox.
false
Type
String
The type of textbox. This can be values such as text, password or email.
false
Disabled
SwitchParameter
Whether this textbox is disabled.
false
Icon
Object
The icon to show next to the textbox.
false
Autofocus
SwitchParameter
Whether to autofocus this textbox.
false
Multiline
SwitchParameter
Whether the textbox accepts multiple lines.
false
Rows
int
The number of rows in a multiline textbox
false
RowsMax
int
The max number of rows in a multiline textbox
false
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Disabled
SwitchParameter
Whether this switch is disabled.
false
OnChange
Endpoint
A script block that is called when this switch changes. The $EventData variable will contain the checked value ($true$false).
false
Checked
Boolean
Whether this switch is checked.
false
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Label
String
The label to show with the time picker.
false
OnChange
Endpoint
A script block to call when the time is changed. The $EventData variable contains the currently selected time.
false
Value
String
The current value of the time picker.
false
Quickly and responsively toggle the visibility value of components and more with the hidden utilities.
Hidden works with a range of breakpoints e.g. xsUp
or mdDown
, or one or more breakpoints e.g. -Only 'sm'
or -Only @('md', 'xl')
. Ranges and individual breakpoints can be used simultaneously to achieve very customized behavior. The ranges are inclusive of the specified breakpoints.
Using any breakpoint -Up
parameter, the given children will be hidden at or above the breakpoint.
Using any breakpoint -Down
parameter, the given children will be hidden at or below the breakpoint.
Using the breakpoint -Only
parameter, the given children will be hidden at the specified breakpoint(s).
The -Only
parameter can be used in two ways:
list a single breakpoint
list an array of breakpoints
Date and time component for Universal Dashboard.
The New-UDDateTime
component is used for formatting dates and times within the client's browser. By using the client's browser, you can format the time based on the local time zone and locale settings for the user.
The date and time component uses DayJS. For a full list of custom formatting options, visit the DayJS documentation.
By default, the date and time will be formatted using the LLL
localized formatting template.
Resulting output: August 16, 2018 8:02 PM
You can specify custom formatting strings using the DayJS formatting template.
Resulting output: 25/01/2019
New-UDDateTime
Name
Type
Description
Required
Id
string
ID of this component.
False
InputObject
string
The date and time to format.
True
Format
string
The DayJS format string.
False
LocalizedFormat
string
The DayJS localized formatting string.
False
Transition component for Universal Dashboard.
Transitions allow you to transition components in and out of view within your dashboard using various animations. You can take advantage of interactive cmdlets like Set-UDElement
to change the transition state and cause an element to move in.
In the following example, we have a card that transitions in via a Fade. Clicking the switch the toggle the card in and out.
The resulting effect looks like this.
The collapse transition will collapse a section in and out. You can specify a collapse height to only collapse a portion of the section.
A fade transition fades a component in and out as seen in the previous example. You can configure the timeout value to specify the number of seconds it takes to complete the transition.
The slide transition moves a component into position. You can determine the position of the slide by specifying the -SlideDirection
parameter.
The grow transition will fade and grow a component into place.
The zoom transition will zoom a component into place.
Drag and drop layout designer.
This component is available on the Universal Dashboard Marketplace
The Grid Layout component is useful for defining layouts in a visual manner. You can drag and drop components using the web interface to automatically define the layout as JSON.
You can employ the -Design parameter to configure the layout of yourr page. This allows dynamic drag and drop of components that you place within the content of the grid layout. As you drag and resize components, the layout will be copied to your clipboard. Note: All components must possess a statid -Id
Once you have configured the layout to fit your needs, you can paste the JSON into your script and assign it with the -Layout parameter. Remove the -Design parameter to lock elements in place.
You can allow your users to dynamically modify layouts by using the -Draggable, -Resizable and -Persist parameters. The layout changes are stored locally so the next time each user visits a page, it will be loaded with their chosen layout.
Grid layout component for Universal Dashboard.
The responsive layout grid adapts to screen size and orientation, ensuring consistency across layouts.
The grid creates visual consistency between layouts while allowing flexibility across a wide variety of designs. Material Design’s responsive UI is based on a 12-column grid layout.
Adjust the spacing between items in the grid
You can also use the New-UDRow
and New-UDColumn
functions when working with the grid.
New-UDGrid
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
ExtraSmallSize
Int32
The size (1-12) for extra small devices.
false
SmallSize
Int32
The size (1-12) for small devices.
false
MediumSize
Int32
The size (1-12) for medium devices.
false
LargeSize
Int32
The size (1-12) for large devices.
false
ExtraLargeSize
Int32
The size (1-12) for extra large devices.
false
Container
SwitchParameter
Whether this is a container. A container can be best described as a row.
false
Spacing
Int32
Spacing between the items.
false
Item
SwitchParameter
Whether this is an item in a container.
false
Children
ScriptBlock
Components included in this grid item.
false
AppBar component for Universal Dashboard
The App Bar displays information and actions relating to the current screen.
The top App Bar provides content and actions related to the current screen. It's used for branding, screen titles, navigation, and actions.
To create an app bar that is pinned to the bottom of the page, you can use the -Footer
parameter.
New-UDAppBar
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Drawer
Hashtable
A drawer that can be opened from this AppBar. Use New-UDDrawer to create a drawer to pass to this parameter.
false
Children
ScriptBlock
Children of this AppBar. The children of an AppBar are commonly text and buttons.
false
Position
String
The position of this AppBar. A fixed position will override the default AppBar.
false
Footer
Switch
Creates an app bar pinned to the bottom of the page.
false
Expansion Panel component for Universal Dashboard
Expansion panels contain creation flows and allow lightweight editing of an element.
An expansion panel is a lightweight container that may either stand alone or be connected to a larger surface, such as a card.
New-UDExpansionPanel
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Title
String
The title show within the header of the expansion panel.
false
Icon
FontAwesomeIcons
An icon to show within the header of the expansion panel.
false
Children
ScriptBlock
Children components to put within the expansion panel.
false
Active
SwitchParameter
Whether the expansion panel is currently active (open).
false
Card component for Universal Dashboard
Cards contain content and actions about a single subject.
Cards are surfaces that display content and actions on a single topic. They should be easy to scan for relevant and actionable information. Elements, like text and images, should be placed on them in a way that clearly indicates hierarchy.
Although cards can support multiple actions, UI controls, and an overflow menu, use restraint and remember that cards are entry points to more complex and detailed information.
You can use the body, header, footer and expand cmdlets to create advanced cards. The below example creates a card with various features based on a Hyper-V VM.
New-UDCard
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
ClassName
String
A CSS class to assign to this card.
false
ShowToolBar
SwitchParameter
Whether to show the toolbar for this card.
false
ToolBar
Object
The toolbar for this card. Use New-UDCardToolbar to create a toolbar.
false
Header
Object
The header for this card. The header typically contains a title for the card. Use New-UDCardHeader to create a header.
false
Body
Object
The body for this card. This is the main content for the card. Use New-UDCardHeader to create a body.
false
Expand
Object
Th expand content for this card. Expand content is show when the user clicks the expansion button. Use New-UDCardExpand to create an expand.
false
Footer
Object
The footer for this card. Footer contents typically contain actions that are relavent to the card. Use New-UDCardFooter to create a footer.
false
Style
Hashtable
Styles to apply to the card.
false
Elevation
Int32
The amount of elevation to provide the card. The more elevation, the more it will appear the card is floating off the page.
false
Title
String
A title for the card.
false
TitleAlignment
String
The alignment for the title.
false
Content
ScriptBlock
The content of the card.
false
Image
String
An image to show in the card.
false
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
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
New-UDStep
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
Paper component for Universal Dashboard
In Material Design, the physical properties of paper are translated to the screen.
The background of an application resembles the flat, opaque texture of a sheet of paper, and an application’s behavior mimics paper’s ability to be re-sized, shuffled, and bound together in multiple sheets.
By default, paper will have rounded edges. You can reduce the rounding by using a square paper.
The -Style
parameter can be used to color paper. Any valid CSS can be included in the hashtable for a style.
The following example creates paper with a red background.
New-UDPaper
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Children
ScriptBlock
The content of this paper element.
false
Width
String
The width of this paper.
false
Height
String
The height of this paper.
false
Square
SwitchParameter
Whether this paper is square.
false
Style
Hashtable
The CSS style to apply to this paper.
false
Elevation
Int32
The elevation of this paper.
false
Tree view component for Universal Dashboard.
New-UDTreeView
allows you to create a tree of items and, optionally, dynamically expand the list when clicked.
Create a basic tree view by using the New-UDTreeNode
cmdlet.
Dynamic tree views allow you to run PowerShell whenever a node is clicked. You can then return a list of nodes that should be rendered underneath the clicked node. You can also take other actions such as opening a modal or showing a toast.
Typography component for Universal Dashboard
Use typography to present your design and content as clearly and efficiently as possible.
Too many type sizes and styles at once can spoil any layout. A typographic scale has a limited set of type sizes that work well together along with the layout grid.
You can use the -Style
parameter to define colors for your text.
New-UDTypography
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Variant
String
The type of text to display.
false
Text
String
The text to format.
false
Content
ScriptBlock
The content to format.
false
Style
Hashtable
A set of CSS styles to apply to the typography.
false
ClassName
String
A CSS className to apply to the typography.
false
Align
String
How to align the typography.
false
GutterBottom
SwitchParameter
The gutter bottom.
false
NoWrap
SwitchParameter
Disables text wrapping.
false
Paragraph
SwitchParameter
Whether this typography is a paragraph.
false
Chip component for Universal Dashboard.
Chips are compact elements that represent an input, attribute, or action.
Chips allow users to enter information, make selections, filter content, or trigger actions.
While included here as a standalone component, the most common use will be in some form of input, so some of the behavior demonstrated here is not shown in context.
Shows a toast when the chip is clicked.
New-UDChip
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Label
String
The label for the chip.
false
OnDelete
Object
A script block to call when the chip is deleted.
false
OnClick
Object
A script block to call when the chip is clicked.
false
Icon
Object
An icon to show within the chip.
false
Style
Hashtable
CSS styles to apply to the chip.
false
Variant
String
The theme variant to apply to the chip.
false
Avatar
String
An avatar to show within the chip.
false
AvatarType
String
The type of avatar to show in the chip.
false
List component for Universal Dashboard.
Lists are continuous, vertical indexes of text or images.
Lists are a continuous group of text or images. They are composed of items containing primary and supplemental actions, which are represented by icons and text.
You can define an action to take when an item is clicked by using the -OnClick
parameter of New-UDListItem
.
New-UDList
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Children
ScriptBlock
The items in the list.
false
SubHeader
String
Text to show within the sub header.
false
New-UDListItem
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
AvatarType
String
The type of avatar to show within the list item.
false
OnClick
Endpoint
A script block to execute when the list item is clicked.
false
Label
String
The label to show within the list item.
false
Children
ScriptBlock
Nested list items to show underneath this list item.
false
SubTitle
String
The subtitle to show within the list item.
false
Icon
Object
The icon to show within the list item.
false
Source
String
Parameter description
false
SecondaryAction
ScriptBlock
The secondary action to issue with this list item.
false
Date Picker component for Universal Dashboard
Date pickers pickers provide a simple way to select a single value from a pre-determined set.
Date pickers can be used in and .
The OnChange event handler is called when the date changes. You can access the current date by using the $Body
variable.
You can customize how the date picker is show. The default is the inline
variant that displays the date picker popup inline with the input control. You can also use the dialog
variant that pops the date picker up in the middle of the screen. Finally, the static
variant displays the date picker without having to click anything.
New-UDDatePicker
Component for uploading files in Universal Dashboard.
The UDUpload component is used to upload files to Universal Dashboard. You can process files the user uploads. You will receive the data for the file, a file name and the type of file if it can be determined by the web browser.
This component works with and .
Uploads a file and shows the contents via a toast.
The body of the OnUpload
script block is a JSON string with the following format.
Uploads a file as part of a UDForm.
The body of the OnSubmit
script block is the same one you will see with any form and the file will be contains as one of the fields within the form.
This example allows a user to upload a file. Once the file is uploaded, it will be saved to the temporary directory.
New-UDUpload
Slider component for Universal Dashboard.
Sliders allow users to make selections from a range of values.
Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness, or applying image filters.
New-UDSlider
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Label
String
The label to show next to the date picker.
false
Variant
String
The theme variant to apply to the date picker.
false
DisableToolbar
SwitchParameter
Disables the date picker toolbar.
false
OnChange
Endpoint
A script block to call with the selected date. The $EventData variable will be the date selected.
false
Format
String
The format of the date when it is selected.
false
Value
DateTime
The current value of the date picker.
false
Name
Type
Description
Required
Id
String
The ID of the component. It defaults to a random GUID.
false
Accept
String
The type of files to accept. By default, this component accepts all files.
false
OnUpload
Endpoint
A script block to call when the file is uploaded.
false
Text
String
The text to display in the upload button.
false
Variant
String
The type of button to show for the upload button.
false
Color
String
The color to use for the upload button.
false
Name
Type
Description
Required
Id
string
false
Value
int[]
false
Minimum
int
false
Maximum
int
false
Disabled
switch
false
Marks
switch
false
OnChange
Endpoint
false
Orientation
string
false
Step
int
false
ValueLabelDisplay
string
false
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
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
New-UDTab
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