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

# Case à cocher

Les cases à cocher permettent à l'utilisateur de sélectionner un ou plusieurs éléments d'un ensemble.

## Cases à cocher

![](/files/3GwbQSyHI67nvg4f2tdB)

Les cases à cocher peuvent être désactivées et cochées par défaut.

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

## Cases à cocher avec icône personnalisée

![](/files/gMZrxrfZ99WphQ3yMW60)

Créez des cases à cocher utilisant n'importe quelle icône et style.

```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'}
```

## Cases à cocher avec bloc de script onChange

Créez des cases à cocher qui déclenchent des blocs de script lors d'un changement.

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

## Case à cocher avec emplacement d'étiquette personnalisé

![](/files/gJAKmnKK2iCo2XGVIbRv)

Vous pouvez ajuster l'emplacement de l'étiquette de la case à cocher.

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

## Obtenir la valeur d'une case à cocher

Vous pouvez utiliser `Get-UDElement` pour obtenir la valeur de la case à cocher. `Get-UDElement` retourne également d'autres propriétés du composant de case à cocher.

L'exemple suivant affiche un message toast avec la valeur de la case à cocher.

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

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

## API

* [New-UDCheckbox](https://github.com/ironmansoftware/universal-docs/blob/v5/cmdlets/New-UDCheckBox.txt)


---

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

```
GET https://docs.devolutions.net/powershell-universal/fr/apps/components/inputs/checkbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
