menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfRadioButton<TChecked> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfRadioButton<TChecked>

    Represents a RadioButton component, which is a graphical interface element that allows users to select a single option from a group. It supports checked and unchecked states for user interaction and custom logic.

    Inheritance
    System.Object
    SfBaseComponent
    SfInputBase<TChecked>
    SfRadioButton<TChecked>
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    SfInputBase<TChecked>.Checked
    SfInputBase<TChecked>.Created
    SfInputBase<TChecked>.CssClass
    SfInputBase<TChecked>.Disabled
    SfInputBase<TChecked>.EnablePersistence
    SfInputBase<TChecked>.EnableRtl
    SfInputBase<TChecked>.FocusAsync()
    SfInputBase<TChecked>.GetPersistData()
    SfInputBase<TChecked>.Name
    SfInputBase<TChecked>.SetLocalStorage(String, TChecked)
    SfInputBase<TChecked>.UpdateCheckState(TChecked)
    SfInputBase<TChecked>.Value
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.CheckedChanged
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.CheckedExpression
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.ChildContent
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.HtmlAttributes
    Namespace: Syncfusion.Blazor.Buttons
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfRadioButton<TChecked> : SfInputBase<TChecked>
    Type Parameters
    Name
    TChecked
    Remarks

    This generic component allows flexible data binding to various types for checked state tracking. The RadioButton supports RTL, persistence, label positioning, and can be easily customized via its component parameters. This class should be used when you want to offer a mutually exclusive choice selection within a UI form or group.

    Examples

    The following example demonstrates how to initialize a basic radio button using the Checked property.

    <SfRadioButton Checked="true">
    </SfRadioButton>

    Constructors

    SfRadioButton()

    Declaration
    public SfRadioButton()

    Properties

    Label

    Gets or sets the label displayed next to the radio button.

    Declaration
    public string Label { get; set; }
    Property Value
    Type Description
    System.String

    A string that specifies the display label of the radio button. The default is String.Empty.

    Remarks

    Use this property to assign custom text to the radio button's label, allowing users to distinguish between radio button options. Leaving this value empty will hide the label from the rendered output.

    LabelPosition

    Gets or sets the position of the label in relation to the radio button.

    Declaration
    public LabelPosition LabelPosition { get; set; }
    Property Value
    Type Description
    LabelPosition

    One of the LabelPosition enumeration values. The default is Before.

    Remarks

    If the LabelPosition is Before, the label appears to the left of the radio button. If set to After, the label appears to the right of the radio button. This property helps control the element flow for better localization and accessibility.

    ValueChange

    Gets or sets an event callback that is invoked when the state of the radio button changes due to user interaction.

    Declaration
    public EventCallback<ChangeArgs<TChecked>> ValueChange { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ChangeArgs<TChecked>>

    An Microsoft.AspNetCore.Components.EventCallback<> that is triggered when the state of the radio button is changed by the user. The callback receives a ChangeArgs<TChecked> argument.

    Remarks

    This event is raised only in response to user-based click actions on the radio button. You can use it to perform custom logic or UI updates whenever the checked state is modified by end-users.

    Examples

    The following example shows how to use the ValueChange event for the radio button:

    <SfRadioButton ValueChange="@Changed">
    </SfRadioButton>
    @code {
        private void Changed(ChangeArgs<TChecked> args)
        {
            // Custom handler code goes here.
        }
    }

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    InitRender(Boolean)

    Declaration
    protected override void InitRender(bool isDynamic = false)
    Parameters
    Type Name Description
    System.Boolean isDynamic
    Overrides
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.InitRender(System.Boolean)

    OnAfterRenderAsync(Boolean)

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.OnAfterRenderAsync(System.Boolean)

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.OnInitializedAsync()

    OnParametersSetAsync()

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.Buttons.SfInputBase<TChecked>.OnParametersSetAsync()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved