RadioButton
This page describes how to create radio buttons in MauiReactor
The .NET Multi-platform App UI (.NET MAUI) RadioButton is a type of button that allows users to select one option from a set. Each option is represented by one radio button, and you can only select one radio button in a group.
Official documentation: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/radiobutton MauiReactor sample app: https://github.com/adospace/mauireactor-samples/tree/main/Controls/RadioButtonTestApp
Group of radio buttons with string content
new VStack(spacing: 5)
{
new RadioButton("Radio 1"),
new RadioButton("Radio 2"),
new RadioButton("Radio 3"),
new RadioButton("Radio 4")
.IsChecked(true)
},
Group of radio buttons with custom content

On Android, you must define a ControlTemplate to show custom content for the radio button.
In MauiReactor you can place the control template in a XAML resource file
This is a sample control template for Android:
Using the above style:

Bonus tip: Radio buttons for an Enum
Say you have an Enum like this:
This code enumerates its values and displays them in a button group:

Last updated
Was this helpful?