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

New-UDButtonGroup

Creates a new button group.

Synopsis

Creates a new button group.

Syntax

New-UDButtonGroup [[-Id] <String>] [[-Children] <ScriptBlock>] [[-ClassName] <String>] [[-Color] <Object>] [-Disabled] [-FullWidth] [[-Orientation] <String>] [[-Size] <String>] [[-Sx] <Hashtable>] [[-Variant] <String>] [<CommonParameters>]

Description

Creates a button group. Use New-UDButtonGroupItem to add new items to the group.

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

-Children

The items in the group.

-ClassName

A CSS class to apply to the button group.

-Color The color of the button group. Valid values are: "primary", "secondary", "success", "warning", "error", "success", "info"Required? falsePosition? 4Default value primaryAccept pipeline input? falseAliasesAccept wildcard characters? false -Disabled [<SwitchParameter>] Disables the button group.Required? falsePosition? namedDefault value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false -FullWidth [<SwitchParameter>] Makes the button group full width.Required? falsePosition? namedDefault value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false-OrientationThe orientation of the button group. Valid values are: "horizontal", "vertical"Required? falsePosition? 5Default value horizontalAccept pipeline input? falseAliasesAccept wildcard characters? false-SizeThe size of the button group. Valid values are: "small", "medium", "large"Required? falsePosition? 6Default value mediumAccept pipeline input? falseAliasesAccept wildcard characters? false-SxAn hashtable of styles to apply to this component.Required? falsePosition? 7Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-VariantThe variant of the button group. Valid values are: "contained", "outlined", "text"Required? falsePosition? 8Default value outlinedAccept 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-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > }Basic button group|The button group offers two items.-------------------------- EXAMPLE 2 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Color 'success'Color|You can use the -Color parameter to change the color of the button group.-------------------------- EXAMPLE 3 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Orientation 'vertical'Vertical|You can use the -Orientation parameter to change the orientation of the button group.-------------------------- EXAMPLE 4 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Size 'small'PS > New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Size 'medium'PS > New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Size 'large'Size|You can use the -Size parameter to change the size of the button group.-------------------------- EXAMPLE 5 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Variant 'contained'PS > New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Variant 'outlined'PS > New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -Variant 'text'Variant|You can use the -Variant parameter to change the variant of the button group.-------------------------- EXAMPLE 6 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -DisabledDisabled|You can use the -Disabled parameter to disable the button group.-------------------------- EXAMPLE 7 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete'PS > New-UDButtonGroupItem -Text 'Copy'PS > } -FullWidthFullWidth|You can use the -FullWidth parameter to make the button group full width.-------------------------- EXAMPLE 8 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete' -Icon (New-UDIcon -Icon 'trash')PS > New-UDButtonGroupItem -Text 'Copy' -Icon (New-UDIcon -Icon 'copy')PS > }Icon|You can use the -Icon parameter to add an icon to the button group item.-------------------------- EXAMPLE 9 --------------------------PS >New-UDButtonGroup -Content {PS > New-UDButtonGroupItem -Text 'Delete' -Icon (New-UDIcon -Icon 'trash') -ShowLoading -OnClick {PS > Start-Sleep -Seconds 5PS > }PS > New-UDButtonGroupItem -Text 'Copy' -Icon (New-UDIcon -Icon 'copy')PS > }Loading|You can use the -ShowLoading parameter to show a loading spinner when the button is clicked.

Last updated

Was this helpful?