Switch
Turn one setting on or off. The change applies immediately.
Usage
import { Switch } from '@smartui/react';
import '@smartui/react/styles.css';When to use
- Settings that take effect right away.
When not to use
- Choices that only apply after saving. Use Checkbox.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
isSelected, defaultSelected, onChange | boolean, boolean, (v) => void | - | |
size | 'md' | 'lg' | 'md' | |
isDisabled | boolean | false | Cannot be pressed or focused. |
Accessibility
- State is shown by thumb position as well as color.