> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/powershell-commands/new-udbuttongroup.md).

# New-UDButtonGroup

### Synopsis

Creates a new button group.

### Syntax

```powershell
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.

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

#### -ClassName

A CSS class to apply to the button group.

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

#### -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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/powershell-commands/new-udbuttongroup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
