# Switch

## Example

```
<kendo-switch>
    <messages />
</kendo-switch>
```

## ChildTags

| Tag Name | Details                                                                                                                                          |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| messages | [SwitchMessagesSettingsTagHelper](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.taghelpers/switchmessagessettingstaghelper) |

## Attributes

| Attribute             | Type                                                                                                 | Description                                                                                                                                                                                                                                                     |
| --------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                  | String                                                                                               | Sets the name of the component.                                                                                                                                                                                                                                 |
| checked               | Boolean                                                                                              | The checked state of the Switch.                                                                                                                                                                                                                                |
| enabled               | Boolean                                                                                              | If set to false, the Switch will be disabled and will not allow the user to change its checked state.                                                                                                                                                           |
| for                   | ModelExpression                                                                                      | An expression to be evaluated against the current model.                                                                                                                                                                                                        |
| on-change             | String                                                                                               | The name of the JavaScript function that will handle the change event. Fires when the checked state of the Switch is changed through user interaction.                                                                                                          |
| on-kendo-keydown      | String                                                                                               | The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the Switch is focused.The event handler function context (available via the this keyword) will be set to the widget instance. |
| readonly              | Boolean                                                                                              | If set to true, the Switch will render into its read-only state.                                                                                                                                                                                                |
| script-attributes     | IDictionary\<String,Object>                                                                          | Sets the attributes that will be added to the script tag of the component's initialization script.                                                                                                                                                              |
| size                  | [ComponentSize](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/componentsize) | Sets the size of the component.                                                                                                                                                                                                                                 |
| thumb-rounded         | [Rounded](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/rounded)             | Sets a value controlling the thumb's border radius.                                                                                                                                                                                                             |
| track-rounded         | [Rounded](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/rounded)             | Sets a value controlling the track's border radius.                                                                                                                                                                                                             |
| width                 | Double                                                                                               | The width of the Switch.                                                                                                                                                                                                                                        |
| is-in-client-template | Boolean                                                                                              | When placing a Tag Helper within a Kendo Template, set the type to text/html and add the is-in-client-template="true" attribute.                                                                                                                                |
| deferred              | Boolean                                                                                              | Suppress initialization script rendering. Note that this options should be used in conjunction with DeferredScripts method.                                                                                                                                     |
| as-module             | Boolean                                                                                              | Specifies whether the initialization script of the component will be rendered as a JavaScript module.                                                                                                                                                           |
