alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class SfSwitch<TChecked>

    Represents a Switch that toggles between checked (ON) and unchecked (OFF) states. Supports keyboard, mouse, and touch interactions, and integrates with form binding.

    Inheritance
    System.Object
    SfBaseComponent
    SfSelectionBase<TChecked>
    SfSwitch<TChecked>
    Implements
    System.IAsyncDisposable
    Inherited Members
    SfBaseComponent.DisposeAsync()
    SfSelectionBase<TChecked>.Checked
    SfSelectionBase<TChecked>.Created
    SfSelectionBase<TChecked>.CssClass
    SfSelectionBase<TChecked>.Disabled
    SfSelectionBase<TChecked>.EnablePersistence
    SfSelectionBase<TChecked>.HasOnChangeEvent
    SfSelectionBase<TChecked>.InitRender(Boolean)
    SfSelectionBase<TChecked>.Name
    SfSelectionBase<TChecked>.OnAfterRenderAsync(Boolean)
    SfSelectionBase<TChecked>.OnInitializedAsync()
    SfSelectionBase<TChecked>.OnParametersSetAsync()
    SfSelectionBase<TChecked>.SetLocalStorageAsync(String, TChecked)
    SfSelectionBase<TChecked>.UpdateCheckStateAsync(TChecked)
    SfSelectionBase<TChecked>.Value
    Syncfusion.Blazor.Toolkit.Inputs.SfSelectionBase<TChecked>.CheckedChanged
    Syncfusion.Blazor.Toolkit.Inputs.SfSelectionBase<TChecked>.CheckedExpression
    Syncfusion.Blazor.Toolkit.Inputs.SfSelectionBase<TChecked>.ChildContent
    Syncfusion.Blazor.Toolkit.Inputs.SfSelectionBase<TChecked>.HtmlAttributes
    Namespace: Syncfusion.Blazor.Toolkit.Inputs
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class SfSwitch<TChecked> : SfSelectionBase<TChecked>, IAsyncDisposable
    Type Parameters
    Name Description
    TChecked

    The type of the checked state value, typically bool.

    Constructors

    SfSwitch()

    Declaration
    public SfSwitch()

    Properties

    OffLabel

    Gets or sets the label text displayed when the Switch is in the OFF state.

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

    The label shown for the OFF state. Default: null.

    OnLabel

    Gets or sets the label text displayed when the Switch is in the ON state.

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

    The label shown for the ON state. Default: null.

    ValueChange

    Gets or sets the event callback that fires when the checked state changes through UI interaction.

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

    An Microsoft.AspNetCore.Components.EventCallback<> invoked when the value changes.

    Methods

    BuildRenderTree(RenderTreeBuilder)

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

    Implements

    System.IAsyncDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved