Switch
Switches are UI elements that let users choose between two states—most commonly on/off.
Switch API
Import
import { Switch } from '@mui/base/Switch';
// or
import { Switch } from '@mui/base';
Props of the native component are also available.
The
ref
is forwarded to the root element.To learn how to customize the slot, check out the Overriding component structure guide.
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.