All Components

This website hosts Kendo UI wrappers of Kendo UI for jQuery widgets intended to be used in the React ecosystem.

Go to the native Kendo UI implementations for React

Switch Overview

The Switch enables the user to toggle between checked and unchecked states and displays exclusive choices.

The Switch wrapper for React is a client-side wrapper for Kendo UI Switch widget.

Basic Usage

The following example demonstrates the Switch in action.

class SwitchContainer extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <div className="row">
                <div className="col-xs-12 col-sm-6 example-col">
                    <Switch />
                </div>
            </div>
        );
    }
}
ReactDOM.render(
    <SwitchContainer />,
    document.querySelector('my-app')
);

Features and Functionalities

Events

The following example demonstrates basic Switch events. You can subscribe to all Switch events by the handler name.

class SwitchContainer extends React.Component {
    constructor(props) {
        super(props);
    }

    onChange = (e) => {
        console.log("event :: change");
    }

    render() {
        return (
            <div className="row">
                <div className="col-xs-12 col-sm-6 example-col">
                    <Switch change={this.onChange} />
                </div>
            </div>
        );
    }
}
ReactDOM.render(
    <SwitchContainer />,
    document.querySelector('my-app')
);
In this article