JavaScript/jQuery Switch - Overview

The Switch is a UI component 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.vue
  • <template>
  • <DxSwitch :value="true" />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxSwitch from 'devextreme-vue/switch';
  •  
  • export default {
  • components: {
  • DxSwitch
  • }
  • }
  • </script>
See Also