> 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/da/apps/components/inputs/radio.md).

# Radioknap

Opret grupper af alternativknapper i PowerShell Universal-apps, så brugere kan vælge én mulighed fra et sæt, med standardværdier og hændelseshandlere for ændring.

Radioknapper giver brugeren mulighed for at vælge én valgmulighed fra et sæt.

Brug radioknapper, når brugeren skal se alle tilgængelige valgmuligheder. Hvis de tilgængelige valgmuligheder kan klappes sammen, kan De overveje at bruge en rullemenu, fordi den bruger mindre plads.

Radioknapper bør have den mest anvendte mulighed valgt som standard.

## Simpel radioknap

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

En hændelseshandler, der kaldes, når radiogruppen ændres. Variablen `$EventData` vil indeholde den aktuelle værdi. Variablen `$Body` indeholder den fulde JSON for hændelsen.

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

## Standardværdi

Angiv standardværdien for radiogruppen.

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

## Brugerdefineret formatering

De kan bruge brugerdefineret formatering i radiogruppen. Eksemplet nedenfor vil placere radioknapperne ved siden af hinanden i stedet for oven på hinanden.

```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](/powershell-universal/da/powershell-kommandoer/new-udradio.md)
* [New-UDRadioGroup](/powershell-universal/da/powershell-kommandoer/new-udradiogroup.md)

### Se også

* [Devolutions Academy – Tilføjelse af funktionen til søgning efter brugere](https://academy.devolutions.net/student/activity/3542903-part-2-adding-the-search-users-function)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/da/apps/components/inputs/radio.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
