> 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/radio.md).

# Bouton radio

Les boutons radio permettent à l'utilisateur de sélectionner une option parmi un ensemble.

Utilisez des boutons radio lorsque l'utilisateur doit voir toutes les options disponibles. Si les options disponibles peuvent être réduites, envisagez d'utiliser un menu déroulant, car il occupe moins d'espace.

Les boutons radio doivent avoir l'option la plus couramment utilisée sélectionnée par défaut.

## Radio simple

![](/files/yxSEJRcJOfDunJQPoAOI)

```powershell
New-UDRadioGroup -Label "Day" -Content {
    New-UDRadio -Label Monday -Value 'monday'
    New-UDRadio -Label Tuesday -Value 'tuesday'
    New-UDRadio -Label Wednesday -Value 'wednesday'
    New-UDRadio -Label Thursday -Value 'thursday'
    New-UDRadio -Label Friday  -Value 'friday'
    New-UDRadio -Label Saturday -Value 'saturday'
    New-UDRadio -Label Sunday -Value 'sunday'
}
```

## OnChange

Un gestionnaire d'événements appelé lorsque le groupe de boutons radio est modifié. La variable `$EventData` contiendra la valeur actuelle. La variable `$Body` contient le JSON complet de l'événement.

```powershell
New-UDRadioGroup -Label "Day" -Content {
    New-UDRadio -Label Monday -Value 'monday'
    New-UDRadio -Label Tuesday -Value 'tuesday'
    New-UDRadio -Label Wednesday -Value 'wednesday'
    New-UDRadio -Label Thursday -Value 'thursday'
    New-UDRadio -Label Friday  -Value 'friday'
    New-UDRadio -Label Saturday -Value 'saturday'
    New-UDRadio -Label Sunday -Value 'sunday'
} -OnChange {
    Show-UDToast -Message `$EventData`
}
```

## Valeur par défaut

Définissez la valeur par défaut du groupe de boutons radio.

```powershell
New-UDRadioGroup -Label "Day" -Content {
    New-UDRadio -Label Monday -Value 'monday'
    New-UDRadio -Label Tuesday -Value 'tuesday'
    New-UDRadio -Label Wednesday -Value 'wednesday'
    New-UDRadio -Label Thursday -Value 'thursday'
    New-UDRadio -Label Friday  -Value 'friday'
    New-UDRadio -Label Saturday -Value 'saturday'
    New-UDRadio -Label Sunday -Value 'sunday'
} -Value 'sunday'
```

## Mise en forme personnalisée

Vous pouvez utiliser une mise en forme personnalisée dans le groupe de boutons radio. L'exemple ci-dessous place les boutons radio côte à côte plutôt que les uns au-dessus des autres.

```powershell
New-UDRadioGroup -Label "Day" -Content {
    New-UDRow -Columns {
        New-UDColumn -LargeSize 1 -Content {
            New-UDRadio -Label Monday -Value 'monday'        
        }
        New-UDColumn -LargeSize 1 -Content {
            New-UDRadio -Label Sunday -Value 'sunday'
        }
    }
}
```

## API

* [New-UDRadio](https://github.com/ironmansoftware/universal-docs/blob/v5/cmdlets/New-UDRadio.txt)
* [New-UDRadioGroup](https://github.com/ironmansoftware/universal-docs/blob/v5/cmdlets/New-UDRadioGroup.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/radio.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.
