Radio
Radio and RadioCard options for single selection within a RadioGroup.
Installation
Add the Radio component using the CLI:
Usage
The Radio component provides single selection within a RadioGroup. Place Radio options inside a RadioGroup and bind Value for the selected option. Each Radio needs a unique Value and ChildContent for the label.
Selected: option1
Examples
Grouping
Use a container with multiple Radio components. Bind each via Checked and CheckedChanged to a shared value in the parent. When one is selected, set the value; when unchecked, clear it. No separate group component—the layout and parent state define the group.
Selected: email
Horizontal
Set Vertical="false" on RadioGroup to display options horizontally.
Selected: b
Alignment
Use the Alignment parameter to control how the radio aligns with its label when the label wraps to multiple lines. Options are VerticalAlignment.Top, VerticalAlignment.Center (default), and VerticalAlignment.Bottom.
Top
Center (default)
Bottom
Alignment with label and description
Use Alignment="VerticalAlignment.Top" when you have a main label with a description underneath. The radio aligns with the top of the label so it stays visually anchored to the primary text.
Disabled
Use the Disabled parameter on a Radio to prevent selecting it, or set Disabled on RadioGroup to disable all options.
Selected: yes
Invalid state
Set Invalid="true" to show the invalid state. The radio gets a red border and ring, and the label text turns red. Use this when validation fails (e.g. a required selection that must be made before submit).
API Reference
Radio
Radio option for single selection within a RadioGroup.
Properties
| Name | Type | Description |
|---|---|---|
AdditionalAttributes |
Dictionary<string, Object> |
|
Alignment |
VerticalAlignment |
Vertical alignment of the radio relative to its label. |
ButtonClass |
string |
CSS classes for the radio button element. |
Checked |
bool |
|
CheckedChanged |
EventCallback<bool> |
|
ChildContent |
RenderFragment |
Content displayed next to the radio (alternative to LabelContent). |
Class |
string |
|
Disabled |
bool |
|
Invalid |
bool |
Whether the radio is in an invalid state. When true, sets aria-invalid="true" and applies invalid styling. |
LabelContent |
RenderFragment |
Optional label content displayed next to the radio. |
Size |
Size |
|
Value |
string |
Events
| Name | Type | Description |
|---|---|---|
CheckedChanged |
EventCallback<bool> |
Methods
| Method | Returns | Description |
|---|---|---|
Equals |
bool |
|
GetHashCode |
int |
|
GetType |
Type |
|
SetParametersAsync |
Task |
|
ToString |
string |