# Switch [component-header:sl-switch] Switches allow the user to toggle an option on or off. ```html preview Switch ``` ```jsx react import { SlSwitch } from '@shoelace-style/shoelace/dist/react'; const App = () => Switch; ``` ?> This component works with standard `
` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation. ## Examples ### Checked Use the `checked` attribute to activate the switch. ```html preview Checked ``` ```jsx react import { SlSwitch } from '@shoelace-style/shoelace/dist/react'; const App = () => Checked; ``` ### Disabled Use the `disabled` attribute to disable the switch. ```html preview Disabled ``` ```jsx react import { SlSwitch } from '@shoelace-style/shoelace/dist/react'; const App = () => Disabled; ``` ### Custom Size Use the available custom properties to make the switch a different size. ```html preview ``` ```jsx react import { SlSwitch } from '@shoelace-style/shoelace/dist/react'; const App = () => ( ); ``` [component-metadata:sl-switch]