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

# New-UDChip

New-UDChip crea un elemento compacto de PowerShell Universal que representa una entrada, un atributo o una acción, con un icono, un avatar o un botón de eliminación opcionales.

### Sinopsis

Los chips son elementos compactos que representan una entrada, un atributo o una acción.

### Sintaxis

```powershell
New-UDChip [-Id <String>] [[-Label] <String>] [[-OnDelete] <Endpoint>] [[-OnClick] <Endpoint>] [[-Icon] <Object>] [[-Style] <Hashtable>] [[-Variant] <String>] [[-Size] <String>] [-ClassName <String>] [-Color <String>] [<CommonParameters>]

New-UDChip [-Id <String>] [[-Label] <String>] [[-OnDelete] <Endpoint>] [[-OnClick] <Endpoint>] [[-Style] <Hashtable>] [[-Variant] <String>] [[-Avatar] <String>] [[-AvatarType] <String>] [[-Size] <String>] [-ClassName <String>] [-Color <String>] [<CommonParameters>]
```

### Descripción

Los chips son elementos compactos que representan una entrada, un atributo o una acción.

### Parámetros

#### -Id

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

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

#### -Label

La etiqueta del chip.

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

#### -OnDelete

Un bloque de script que se llama cuando se elimina el chip.

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

#### -OnClick

Un bloque de script que se llama cuando se hace clic en el chip.

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

#### -Icon

Un icono que se muestra dentro del chip.

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

#### -Style

Estilos CSS que se aplican al chip.

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

#### -Variant

La variante de tema que se aplica al chip.

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

#### -Avatar

Un avatar que se muestra dentro del chip.

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

#### -AvatarType

El tipo de avatar que se muestra en el chip.

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

#### -Size

El tamaño del chip. Los valores válidos son: "small", "medium"

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

#### -ClassName

Una clase CSS que se aplica al chip.

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

#### -Color

El color del chip. De forma predeterminada, es 'default'. Valores válidos: "default", "primary", "secondary"

```
Required?                    false
Position?                    named
Default value                default
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 obtener más información, consulte [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Salidas

### Ejemplos

#### Ejemplo 1: chip básico

```powershell
New-UDChip -Label 'Basic' -Icon (New-UDIcon -Icon 'user') -Id 'chip1'
```

Un chip básico con un icono.

#### Ejemplo 2: chip con contorno

```powershell
New-UDChip -Variant outlined -Label 'Outlined' -Icon (New-UDIcon -Icon 'user') -Id 'chip2'
```

Un chip con contorno y un icono.

#### Ejemplo 3: chip en el que se puede hacer clic

```powershell
New-UDChip -Label 'Clickable' -Icon (New-UDIcon -Icon 'user') -OnClick {
   Show-UDToast -Message 'Hello!'
} -Id 'chip3'
```

Un chip con un icono en el que se puede hacer clic.

#### Ejemplo 4: chip que se puede eliminar

```powershell
New-UDChip -Label 'Deletable' -Icon (New-UDIcon -Icon 'user') -OnDelete {
   Show-UDToast -Message 'Deleted!'
} -Id 'chip4'
```

Un chip con un icono que se puede eliminar.

#### Ejemplo 5: chip en el que se puede hacer clic y que se puede eliminar

```powershell
New-UDChip -Label 'Clickable and deletable' -Icon (New-UDIcon -Icon 'user') -OnClick {
   Show-UDToast -Message 'Hello!'
} -OnDelete {
   Show-UDToast -Message 'Deleted!'
} -Id 'chip5'
```

Un chip con un icono en el que se puede hacer clic y que se puede eliminar.

#### Ejemplo 6: chip con avatar

```powershell
New-UDChip -Avatar "A" -AvatarType letter -Label 'Avatar' -Id 'chip6'
```

Un chip con un avatar.

#### Ejemplo 7: chip con imagen

```powershell
New-UDChip -Avatar "https://picsum.photos/200/300" -AvatarType image -Label 'Avatar' -Id 'chip7'
```

Un chip con una imagen de avatar.

#### Ejemplo 8: chip pequeño

```powershell
New-UDChip -Label 'Small' -Icon (New-UDIcon -Icon 'user') -Size small -Id 'chip8'
```

Un chip pequeño con un icono.

#### Ejemplo 9

```powershell
New-UDChip -Style @{background = 'red'; color = 'white'} -Label 'Styled' -Icon (New-UDIcon -Icon 'user') -Id 'chip9'
```


---

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