# Blazor RadioGroup Overview

The <a href="https://www.telerik.com/blazor-ui/radiogroup" target="_blank">Blazor RadioGroup component</a> allows the user to select an option from a predefined set of choices in a list of radio buttons. The radio group is styled according to the Telerik [Theme](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/overview). You can also choose the [layout order](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/layout) and [label position](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/label-position).

## Creating Blazor RadioGroup

1. Add the `<TelerikRadioGroup>` tag to a Razor file.

2. Populate its `Data` property with the collection of items you want in the list.

3. Set the `Value` parameter to an object. It supports one-way and two-way binding.

4. Set the `TextField` and `ValueField` properties to point to the corresponding properties of the model.

> caption Basic Radio Button Group configuration.

<demo metaUrl="client/radiogroup/overview/example-2/" height="420"></demo>

## Data Binding

The Blazor RadioGroup supports data binding to strings, [value type](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types) data, and a model collection. [Read more about the Blazor RadioGroup data binding](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/data-bind).

## Layout

The RadioGroup component provides two ways to render the list of options - in a *vertical* or in a *horizontal* fashion. [Read more about the Blazor RadioGroup layouts](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/layout).

## Label Position

The RadioGroup component provides two ways to render the labels of the radio buttons - *before* or *after* the radio buttons. [Read more about the Blazor RadioGroup label position](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/label-position).

## Appearance Settings

The Blazor RadioGroup provides a `Size` parameter to customize the radio button dimensions. [Read more about the Blazor RadioGroup appearance settings](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/appearance).

## Templates

The [RadioGroup item template](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/templates) allows customization of the content of each radio item.

## Events

The Blazor RadioGroup fires blur and value change events to respond to user actions. [Read more about the Blazor RadioGroup events](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/events).

## RadioGroup Parameters

The Blazor RadioGroup provides various parameters to configure the component. Also check the [RadioGroup public API](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikradiogroup-2).

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter       | Type and Default Value                          | Description                                                                                                                                                                       |
| --------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Class`         | `string`                                        | The custom CSS class for the main wrapping element, which is `<ul class="k-radio-list">`.                                                                                         |
| `Enabled`       | `bool` <br /> (`true`)                          | Whether the component is enabled.                                                                                                                                                 |
| `Id`            | `string`                                        | The `id` attribute of the main wrapping element.                                                                                                                                  |
| `LabelPosition` | `RadioGroupLabelPosition` enum <br /> (`After`) | Whether the labels render after or before the radio button itself.                                                                                                                |
| `Layout`        | `RadioGroupLayout` enum <br /> (`Vertical`)     | Whether the buttons are rendered vertically or horizontally.                                                                                                                      |
| `Name`          | `string`                                        | Sets a `name` attribute to the `<input type="radio">` elements.                                                                                                                   |
| `TItem`         | `object`                                        | The type of the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.                              |
| `TValue`        | `object`                                        | The type of the value field from the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.         |
| `TextField`     | `string` <br /> (`Text`)                        | The name of the field from the model that will be shown to the user.                                                                                                              |
| `ValueField`    | `string` <br /> (`Value`)                       | The name of the field from the model that will populate the underlying `Value`.                                                                                                   |
| `Value`         | `object`                                        | The value of the component. Supports one and two-way binding. If the `Value` matches a `ValueField` value in the Data, the corresponding item from the data will be pre-selected. |

See the [Input Validation](https://www.telerik.com/blazor-ui/documentation/common-features/input-validation) article for more details.

## RadioGroup Reference and Methods

The RadioGroup provides a `FocusItemAsync` method that allows the application to focus a specific radio input programmatically. It accepts an integer parameter representing the index of the radio button you want to focus. To use it, obtain the component reference through its `@ref` attribute.

> caption Using RadioGroup `FocusItemAsync` method

<demo metaUrl="client/radiogroup/overview/example-1/" height="420"></demo>

## Next Steps

* [Bind the RadioGroup to Data](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/data-bind)
* [Handle the RadioGroup Events](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/events)
* [Explore the RadioGroup Layouts](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/layout)
* [Customize the RadioGroup Item Rendering with Templates](https://www.telerik.com/blazor-ui/documentation/components/radiogroup/templates)

## See Also

* [Live RadioGroup Demos](https://demos.telerik.com/blazor-ui/radiogroup/overview)
* [RadioGroup API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikradiogroup-2)
