> 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/aplicaciones/components/inputs/checkbox.md).

# Casilla de verificación

Las casillas de verificación permiten al usuario seleccionar uno o más elementos de un conjunto.

## Casillas de verificación

![](/files/ccOS13ZpePteWcEslkd8)

Las casillas de verificación se pueden desactivar y marcar de forma predeterminada

```powershell
New-UDCheckBox
New-UDCheckBox -Disabled
New-UDCheckBox -Checked $true
New-UDCheckBox -Checked $true -Disabled
```

## Casillas de verificación con icono personalizado

![](/files/8gHIBSix8SDKm5U8wzdj)

Cree casillas de verificación que usen cualquier icono y estilo.

```powershell
$Icon = New-UDIcon -Icon angry -Size lg -Regular
$CheckedIcon = New-UDIcon -Icon angry -Size lg
New-UDCheckBox -Icon $Icon -CheckedIcon $CheckedIcon -Style @{color = '#2196f3'}
```

## Casillas de verificación con bloque de script onChange

Cree casillas de verificación que ejecuten bloques de script al cambiar.

```powershell
New-UDCheckBox -OnChange {
    Show-UDToast -Title 'Checkbox' -Message $Body
}
```

## Casilla de verificación con ubicación de etiqueta personalizada

![](/files/spnTGXdqg9zKVFxntqXB)

Puede ajustar dónde se coloca la etiqueta de la casilla de verificación.

```powershell
New-UDCheckBox -Label 'Demo' -LabelPlacement start
New-UDCheckBox -Label 'Demo' -LabelPlacement top
New-UDCheckBox -Label 'Demo' -LabelPlacement bottom
New-UDCheckBox -Label 'Demo' -LabelPlacement end
```

## Obtener el valor de una casilla de verificación

Puede usar `Get-UDElement` para obtener el valor de la casilla de verificación. `Get-UDElement` también devolverá otras propiedades del componente de casilla de verificación.

El siguiente ejemplo muestra un mensaje toast con el valor de la casilla de verificación.

```powershell
New-UDCheckbox -Id 'MyCheckbox' 

New-UDButton -Text 'Get Value' -OnClick {
    Show-UDToast -Message (Get-UDElement -Id 'MyCheckbox').checked
}
```

## API

* [New-UDCheckbox](/powershell-universal/es/comandos-de-powershell/new-udcheckbox.md)


---

# 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/aplicaciones/components/inputs/checkbox.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.
