Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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
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
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 .
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 .
Resulting output: 25/01/2019
New-UDDateTime
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
New-UDListItem
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
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
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
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
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
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.
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.
Defines column properties for a table.
Returns data from the -LoadData
parameter of New-UDTable
.
Allows for custom text in the table controls.
For a full example of server-side processing, .
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
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
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
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
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