> 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-udiconbutton.md).

# New-UDIconButton

New-UDIconButton crea un botón compuesto únicamente por un icono en PowerShell Universal, lo que le permite definir el icono, el tamaño, la variante y la acción de clic para controles de interfaz comp

### Sinopsis

Crea un botón con un icono.

### Sintaxis

```powershell
New-UDIconButton [[-Id] <String>] [[-Icon] <Object>] [[-OnClick] <Endpoint>] [-Disabled] [[-Href] <String>] [[-Style] <Hashtable>] [[-ClassName] <String>] [[-Size] <String>] [[-Variant] <String>] [-ShowLoading] [[-LoadingComponent] <ScriptBlock>] [<CommonParameters>]
```

### Descripción

Crea un botón con un icono.

### Parámetros

#### -Id

El ID del componente. De forma predeterminada, es un GUID aleatorio.

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

#### -Icon

El icono que se muestra dentro del botón.

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

#### -OnClick

Un bloque de script que se ejecuta al hacer clic en el botón.

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

#### -Disabled

Si el botón está deshabilitado.

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

#### -Href

Un enlace al que navegar cuando se hace clic en el botón.

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

#### -Style

El estilo CSS que se aplica al icono.

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

#### -ClassName

Una clase CSS que se aplica al icono.

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

#### -Size

El tamaño del botón de icono. Los valores válidos son: "small", "medium", "large"

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

#### -Variant

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

#### -ShowLoading

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

#### -LoadingComponent

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

#### Parámetros comunes

Este cmdlet admite los parámetros comunes: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable y OutVariable. Para más información, consulte [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Salidas

### Ejemplos

#### Ejemplo 1: botón de icono básico

```powershell
New-UDIconButton -Icon (New-UDIcon -Icon user -Size sm)  -Id 'iconButton1'
```

Crea un botón de icono básico.

#### Ejemplo 2: botón de icono con OnClick

```powershell
New-UDIconButton -Icon (New-UDIcon -Icon user -Size sm) -OnClick {
   Show-UDToast -Message 'Icon Button Clicked'
} -Id 'iconButton2'
```

Crea un botón de icono con un bloque de script OnClick.

#### Ejemplo 3: botón de icono con Href

```powershell
New-UDIconButton -Icon (New-UDIcon -Icon user -Size sm) -Href 'https://www.google.com' -Id 'iconButton3'
```

Crea un botón de icono que navega a una URL.

#### Ejemplo 4: botón de icono deshabilitado

```powershell
New-UDIconButton -Icon (New-UDIcon -Icon user -Size sm) -Disabled -Id 'iconButton4'
```

Crea un botón de icono deshabilitado.

#### Ejemplo 5: botón de icono con carga

```powershell
New-UDIconButton -Icon (New-UDIcon -Icon user -Size sm) -Id 'iconButton5' -OnClick {
   Show-UDToast -Message 'Icon Button Clicked'
   Start-Sleep -Seconds 5
} -ShowLoading
```

Crea un botón de icono con un indicador de carga.


---

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