SwitchUnstyled API
API documentation for the React SwitchUnstyled component. Learn about the available props, and the CSS API.
Import
import SwitchUnstyled from '@mui/core/SwitchUnstyled';
// 或
import { SwitchUnstyled } from '@mui/core';属性
Props of the 原生(Native) component are also available.
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| checked | bool | false | |
| className | string | ||
| component | elementType | ||
| components | { Input?: elementType, Root?: elementType, Thumb?: elementType, Track?: elementType | null } | {} | |
| componentsProps | object | {} | |
| defaultChecked | bool | false | |
| disabled | bool | false | |
| onChange | func | ||
| readOnly | bool | false | |
| required | bool | false |
ref 则会被传递到根元素中。