New to Telerik UI for ASP.NET CoreStart a free 30-day trial

ASP.NET Core Switch Overview

The Telerik UI Switch TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI Switch widget.

The Switch displays two exclusive choices, and when initialized, the Switch renders the currently selected value.

By default, the labels of the Switch are not visible when using Bootstrap or Material themes.

Initializing the Switch

The following example demonstrates how to define the Switch.

Razor
    @(Html.Kendo().Switch()
        .Name("switch") // The name of the Switch is mandatory. It specifies the "id" attribute of the widget.
        .Checked(true)
    )

Basic Configuration

The configuration options of the Switch are passed as attributes.

Razor
    @(Html.Kendo().Switch()
        .Name("switch")
        .Checked(true)
        .Enabled(true))

Functionality and Features

  • Appearance—The Switch enables you to customize its appearance based on your requirements.
  • Events—The Switch allows you to handle its events and implement custom functionality.
  • Accessibility—The Switch provides accessibility support through its keyboard navigation.

To learn more about the appearance, anatomy, and accessibility of the Switch, visit the Progress Design System documentation—an information portal offering rich component usage guidelines, descriptions of the available style variables, and globalization support details.

Next Steps

See Also