Label and Size in Blazor RadioButton Component

28 Sep 20231 minute to read

This section explains the different sizes and labels.

Label

Radio Button caption can be defined by using the Label property. This reduces the manual addition of label for Radio Button. You can customize the label position before or after the Radio Button through the LabelPosition property.

@using Syncfusion.Blazor.Buttons

<SfRadioButton Label="Left Side Label" Name="position" LabelPosition="LabelPosition.Before" Value="Left"  @bind-Checked="stringChecked"></SfRadioButton><br />
<SfRadioButton Label="Right Side Label" Name="position" LabelPosition="LabelPosition.After" Value="Right" @bind-Checked="stringChecked"></SfRadioButton>

@code {
    private string stringChecked ="Right";
}

Blazor RadioButton with Label

Size

The different Radio Button sizes available are default and small. To reduce the size of the default Radio Button to small, set the CssClass property to e-small.

@using Syncfusion.Blazor.Buttons

<SfRadioButton Label="Small" Name="size" CssClass="e-small" Value="Small" @bind-Checked="stringChecked"></SfRadioButton><br />
<SfRadioButton Label="Default" Name="size" Value="Default" @bind-Checked="stringChecked"></SfRadioButton>

@code {
    private string stringChecked ="Default";
}

Blazor RadioButton with Different Size

See Also