Skip to Content
SmartUI

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

PropTypeDefaultDescription
isSelected, defaultSelected, onChangeboolean, boolean, (v) => void-
size'md' | 'lg''md'
isDisabledbooleanfalseCannot be pressed or focused.

Accessibility

  • State is shown by thumb position as well as color.

On this page