New-UDIconButton
Synopsis
Creates a button with an icon.
Syntax
New-UDIconButton [[-Id] <String>] [[-Icon] <Object>] [[-OnClick] <Endpoint>] [-Disabled] [[-Href] <String>] [[-Style] <Hashtable>] [[-ClassName] <String>] [[-Size] <String>] [[-Variant] <String>] [-ShowLoading] [[-LoadingComponent] <ScriptBlock>] [[-Aria] <ScriptBlock>] [<CommonParameters>]Description
Creates a button with an icon.
Parameters
-Id
The ID of the component. It defaults to a random GUID.
Required? false
Position? 1
Default value ([Guid]::NewGuid()).ToString()
Accept pipeline input? false
Aliases
Accept wildcard characters? false-Icon
The icon to display within the button.
-OnClick
A script block to execute when the button is clicked.
-Disabled
Whether the button is disabled.
-Href
A link to navigate to when the button is clicked.
-Style
The CSS sytle to apply to the icon.
-ClassName
A CSS class to apply to the icon.
-Size
The size of the icon button. Valid values are: "small", "medium", "large"
-Variant
-ShowLoading
-LoadingComponent
-Aria
A script block of New-UDAriaAttribute calls that supplies ARIA or role attributes for this icon button. Provide an accessible label for icon-only controls, such as -Aria { New-UDAriaAttribute -Label -Value 'Open settings' }.
Common parameters
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.
Outputs
Examples
Example 1: Basic Icon Button
Creates a basic icon button.
Example 2: Icon Button with OnClick
Creates an icon button with an OnClick script block.
Example 3: Icon Button with Href
Creates an icon button that navigates to a URL.
Example 4: Disabled Icon Button
Creates a disabled icon button.
Example 5: Icon Button with Loading
Creates an icon button with a loading spinner.
Last updated
Was this helpful?