For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-UDSwitch

Creates a new switch.

Synopsis

Creates a new switch.

Syntax

New-UDSwitch [[-Id] <String>] [-Disabled] [[-OnChange] <Endpoint>] [[-Checked] <Boolean>] [[-ClassName] <String>] [[-Color] <String>] [[-Label] <String>] [[-LabelComponent] <Hashtable>] [[-CheckedLabel] <String>] [[-CheckedLabelComponent] <Hashtable>] [[-UncheckedLabel] <String>] [[-UncheckedLabelComponent] <Hashtable>] [[-Size] <String>] [[-LabelPlacement] <String>] [-CheckStyle] [[-Sx] <Hashtable>] [[-Style] <Hashtable>] [<CommonParameters>]

Description

Creates a new switch. A switch behaves like a checkbox but looks a little different.

Parameters

-Id

The ID of the component. It defaults to a random GUID.

Required?                    false
Position?                    1
Default value                ([Guid]::NewGuid())
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false

    -Disabled [<SwitchParameter>]
        Whether this switch is disabled.

Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false

-OnChange

A script block that is called when this switch changes. The $EventData variable will contain the checked value ($true$false).

-Checked

Whether this switch is checked.

-ClassName

A CSS class to apply to the switch.

-Color

The theme color to apply to this switch.

-Label

The label to display next to the switch

-LabelComponent

-CheckedLabel

The label to display for when the switch is checked

-CheckedLabelComponent

-UncheckedLabel

The label to display for when the switch is unchecked

-UncheckedLabelComponent

-Size

The size of the switch. Valid values are: "small", "medium"

-LabelPlacement

The placement of the label. Valid values are: "top", "start", "right", "bottom"

-Sx

A hashtable of theme-based styles to apply to the switch.

-Style

A hashtable of styles to apply to the switch.

Outputs

-------------------------- EXAMPLE 1 --------------------------

Last updated

Was this helpful?