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

New-UDCheckBox

Creates a checkbox.

Synopsis

Creates a checkbox.

Syntax

New-UDCheckBox [[-Label] <String>] [[-Icon] <Object>] [[-CheckedIcon] <Object>] [[-OnChange] <Endpoint>] [[-Style] <Hashtable>] [[-Disabled]] [[-Checked] <Boolean>] [[-ClassName] <String>] [[-LabelPlacement] <String>] [[-Id] <String>] [[-Size] <String>] [-Color <String>] [-Indeterminate] [<CommonParameters>]

Description

Creates a checkbox. Checkboxes can be used in forms or by themselves.

Parameters

-Label

The label to show next to the checkbox.

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

-Icon The icon to show instead of the default icon. Use New-UDIcon to create an icon.Required? falsePosition? 2Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-CheckedIcon The icon to show instead of the default checked icon. Use New-UDIcon to create an icon.Required? falsePosition? 3Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-OnChangeCalled when the value of the checkbox changes. The $EventData variable will have the current value of the checkbox.Required? falsePosition? 4Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-StyleA hashtable of styles to apply to the checkbox.Required? falsePosition? 5Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false -Disabled [<SwitchParameter>] Whether the checkbox is disabled.Required? falsePosition? 6Default value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false-CheckedWhether the checkbox is checked.Required? falsePosition? 7Default value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false-ClassNameA CSS class to assign to the checkbox.Required? falsePosition? 8Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-LabelPlacementWhere to place the label. Valid values are: "top","start","bottom","end"Required? falsePosition? 8Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-IdThe ID of the component. It defaults to a random GUID.Required? falsePosition? 9Default value ([Guid]::NewGuid()).ToString()Accept pipeline input? falseAliasesAccept wildcard characters? false-SizeThe size of the checkbox. Valid values are: "small", "medium"Required? falsePosition? 10Default value mediumAccept pipeline input? falseAliasesAccept wildcard characters? false-ColorThe theme color to apply to this componentRequired? falsePosition? namedDefault value defaultAccept pipeline input? falseAliasesAccept wildcard characters? false -Indeterminate [<SwitchParameter>] Whether the checkbox is in an indeterminate state. This is a visual state only and does not affect the value of the checkbox.Required? falsePosition? namedDefault value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false <CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).Outputs-------------------------- EXAMPLE 1 --------------------------PS >New-UDCheckbox -Label 'Demo' -Id 'checkbox1'Basic checkbox|A basic checkbox.-------------------------- EXAMPLE 2 --------------------------PS >New-UDCheckbox -Label 'Demo' -Disabled -Id 'checkbox2'Disabled checkbox|A disabled checkbox.-------------------------- EXAMPLE 3 --------------------------PS >New-UDCheckbox -Label 'Demo' -Checked $true -Id 'checkbox3'Checked checkbox|A checked checkbox.-------------------------- EXAMPLE 4 --------------------------PS >New-UDCheckbox -Label 'Demo' -Icon (New-UDIcon -Icon 'user') -CheckedIcon (New-UDIcon -Icon 'check') -Id 'checkbox4'Checkbox with custom icons|A checkbox with custom icons.-------------------------- EXAMPLE 5 --------------------------PS >New-UDCheckbox -Label 'Demo' -OnChange {PS > Show-UDToast -Title 'Checkbox' -Message $BodyPS > } -Id 'checkbox5'Checkbox with OnChange|A checkbox with an OnChange event.-------------------------- EXAMPLE 6 --------------------------PS >New-UDCheckbox -Label 'Demo' -LabelPlacement 'top' -Id 'checkbox6'Checkbox with label on top|A checkbox with the label on top.-------------------------- EXAMPLE 7 --------------------------PS >New-UDCheckbox -Label 'Demo' -Color 'secondary' -Id 'checkbox7'Checkbox with secondary color|A checkbox with the secondary color.-------------------------- EXAMPLE 8 --------------------------PS >New-UDCheckbox -Label 'Demo' -Id 'checkbox8' -IndeterminateCheckbox in indeterminate state|A checkbox in an indeterminate state.

Last updated

Was this helpful?