Switch

Switch

The <Switch> component is a styled wrapper around the native <input type="checkbox"> element, usually used to toggle a setting on or off.

Example

Use it as you would any checkbox in React:

const [checked, setChecked] = useState(false);
 
<Switch checked={checked} onChange={(e) => setChecked(e.target.checked)} />;