DevExtreme React - Overview

The Switch is a widget that can be in two states: "On" (when value is true) and "Off" (when value is false).

View Demo

The following code adds the Switch to your page.

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Switch from 'devextreme-react/switch';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Switch defaultValue={true} />
  • );
  • }
  • }
  • export default App;
See Also