> 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/es/comandos-de-powershell/new-udbutton.md).

# New-UDButton

### Sinopsis

Los botones permiten a los usuarios realizar acciones y tomar decisiones con un solo toque..

### Sintaxis

```powershell
New-UDButton [[-Text] <String>] [[-Icon] <Object>] [[-Variant] <String>] [[-IconAlignment] <String>] [[-FullWidth]] [[-OnClick] <Endpoint>] [[-Size] <String>] [[-Style] <Hashtable>] [[-Href] <String>] [-Target <String>] [-Id <String>] [-Color <String>] [-Disabled] [-ClassName <String>] [-ShowLoading] [-LoadingIndicator <Object>] [-LoadingPosition <String>] [<CommonParameters>]
```

### Descripción

Crea un nuevo botón. Los botones permiten a los usuarios realizar acciones y tomar decisiones con un solo toque.

### Parámetros

#### -Text

El texto que se muestra dentro del botón.

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

#### -Icon Un icono que se muestra dentro del botón. Use New-UDIcon para crear un icono para este parámetro.Required?                    falsePosition?                    2Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-VariantEl tipo de variante de este botón. Los valores válidos son: "text", "outlined", "contained"Required?                    falsePosition?                    3Default value                containedAccept pipeline input?       falseAliasesAccept wildcard characters?  false-IconAlignmentCómo alinear el icono dentro del botón. Los valores válidos son: "left", "right"Required?                    falsePosition?                    4Default value                leftAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -FullWidth \[\<SwitchParameter>]        Whether the button takes the full width of the it's container.Required?                    falsePosition?                    7Default value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-OnClickLa acción que se debe realizar al hacer clic en el botón.Required?                    falsePosition?                    8Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-SizeEl tamaño del botón. Los valores válidos son: "small", "medium", "large"Required?                    falsePosition?                    9Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-StyleEstilos que se aplican al botón.Required?                    falsePosition?                    10Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-HrefUna URL a la que se debe redirigir al usuario al hacer clic en el botón.Required?                    falsePosition?                    11Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-TargetRequired?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-IdEl ID del componente. Por defecto es un GUID aleatorio.Required?                    falsePosition?                    namedDefault value                (\[Guid]::NewGuid()).ToString()Accept pipeline input?       falseAliasesAccept wildcard characters?  false-ColorEl color del componente. Los valores válidos son: 'default', 'inherit', 'primary', 'secondary', 'info', 'warning', 'error', 'success'Required?                    falsePosition?                    namedDefault value                primaryAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -Disabled \[\<SwitchParameter>]        Whether the button is disabled.Required?                    falsePosition?                    namedDefault value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-ClassNameLa clase CSS que se aplica al botón.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -ShowLoading \[\<SwitchParameter>]        Displays a loading spinner while the OnClick event handler is running.Required?                    falsePosition?                    namedDefault value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-LoadingIndicator Un elemento personalizado que se muestra en lugar del indicador de carga integrado para -ShowLoadingRequired?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-LoadingPositionLa posición del indicador de carga. Los valores válidos son: 'start', 'end', 'center'Required?                    falsePosition?                    namedDefault value                centerAccept 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).Salidas--------------------------> EJEMPLO 1 --------------------------PS >New-UDButton -Variant 'text' -Text 'Text' -Id 'button1'PS > New-UDButton -Variant 'contained' -Text 'Contained'  -Id 'button2'PS > New-UDButton -Variant 'outlined' -Text 'Outlined' -Id 'button3'Basic buttons|UDButton comes with three variants: text, contained, and outlined.-------------------------- EXAMPLE 2 --------------------------PS >New-UDButton -Text 'Click me' -OnClick {PS >   Show-UDToast -Message 'Hello, world!'PS > } -Id 'button4'Handling clicks|PowerShell that is executed when the button is clicked.-------------------------- EXAMPLE 3 --------------------------PS >New-UDButton -Text 'Secondary' -Color secondary -Id 'button5'PS > New-UDButton -Text 'Success' -Color success -Id 'button6'PS > New-UDButton -Text 'Error' -Color error -Id 'button7'Color|Adjust the button color with -Color-------------------------- EXAMPLE 4 --------------------------PS >New-UDButton -Variant 'text' -Text 'small' -Id 'button8' -Size smallPS > New-UDButton -Variant 'text' -Text 'medium'  -Id 'button9' -Size mediumPS > New-UDButton -Variant 'text' -Text 'large' -Id 'button10' -Size largePS > New-UDButton -Variant 'contained' -Text 'small' -Id 'button11'  -Size smallPS > New-UDButton -Variant 'contained' -Text 'medium'  -Id 'button12'  -Size mediumPS > New-UDButton -Variant 'contained' -Text 'large' -Id 'button13'  -Size largePS > New-UDButton -Variant 'outlined' -Text 'small' -Id 'button14'  -Size smallPS > New-UDButton -Variant 'outlined' -Text 'medium'  -Id 'button15'  -Size mediumPS > New-UDButton -Variant 'outlined' -Text 'large' -Id 'button16'  -Size largeSizes|For larger or smaller buttons, use the -Size parameter.-------------------------- EXAMPLE 5 --------------------------PS >New-UDButton -Icon (New-UDIcon -Icon 'User') -Text 'View User' -Id 'button17'Icon|Display an icon within the button-------------------------- EXAMPLE 6 --------------------------PS >New-UDButton -OnClick { Start-Sleep 3 } -ShowLoading -Text 'Load Data' -Id 'button18'Loading|Show a loading indicator while the OnClick event handler is running.


---

# 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/es/comandos-de-powershell/new-udbutton.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.
