Telerik UI for ASP.NET Core Switch Basic Usage
-
EXAMPLEVIEW SOURCE
- EDIT IN
Also available for:
CLIENT-SIDE API HTML HELPER APIThe Switch component is part of Telerik UI for ASP.NET Core, a professional grade UI library with 120+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
Description
The Telerik UI for ASP.NET Core Switch is a component that displays two exclusive choices–checked and unchecked. Also known as a Toggle button, the Switch control supports configuration options for easy customization.
The current example displays a common use-case scenario for a Switch component.
The ASP.NET Core Switch control is part of Telerik UI for ASP.NET Core, a professional-grade UI library with 120+ components for building modern and feature-rich web applications. The Switch is a server-side wrapper for the Kendo UI for jQuery Switch component and supports an HtmlHelper and a TagHelper mode.
Functionality and Features
- Label messages—Define the texts of the checked and unchecked Switch labels.
- Enabled, disabled, and readonly state—Choose to enable, disable, or make the Switch read-only. For example, if you may want to disable the input for non-authorized users.
- Bind-value and valueSet and get the Switch value, and use the
SwitchFor()configuration to bind the component to aModelproperty. - Appearance—Set the size and radius of the track and thumb border.
- API—Use the API functions to dynamically change the state of the Switch.
- Accessibility, keyboard navigation, and RTL support—The Switch is accessible for screen readers, supports WAI-ARIA attributes, and delivers keyboard shortcuts for faster navigation. The component also enables you to render it in a right-to-left direction.