Files
react-test/docs/pages/material-ui/api/switch.json

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

169 lines
5.8 KiB
JSON
Raw Normal View History

2025-12-12 14:26:25 +09:00
{
"props": {
"checked": { "type": { "name": "bool" } },
"checkedIcon": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
"color": {
"type": {
"name": "union",
"description": "'default'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;'error'<br>&#124;&nbsp;'info'<br>&#124;&nbsp;'success'<br>&#124;&nbsp;'warning'<br>&#124;&nbsp;string"
},
"default": "'primary'"
},
"defaultChecked": { "type": { "name": "bool" } },
"disabled": { "type": { "name": "bool" } },
"disableRipple": { "type": { "name": "bool" }, "default": "false" },
"edge": {
"type": {
"name": "enum",
"description": "'end'<br>&#124;&nbsp;'start'<br>&#124;&nbsp;false"
},
"default": "false"
},
"icon": { "type": { "name": "node" } },
"id": { "type": { "name": "string" } },
"inputProps": {
"type": { "name": "object" },
"deprecated": true,
"deprecationInfo": "Use <code>slotProps.input</code> instead. This prop will be removed in a future major release. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"inputRef": {
"type": { "name": "custom", "description": "ref" },
"deprecated": true,
"deprecationInfo": "Use <code>slotProps.input.ref</code> instead. This prop will be removed in a future major release. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"onChange": {
"type": { "name": "func" },
"signature": {
"type": "function(event: React.ChangeEvent<HTMLInputElement>) => void",
"describedArgs": ["event"]
}
},
"required": { "type": { "name": "bool" }, "default": "false" },
"size": {
"type": {
"name": "union",
"description": "'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
"slotProps": {
"type": {
"name": "shape",
"description": "{ input?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object, switchBase?: func<br>&#124;&nbsp;object, thumb?: func<br>&#124;&nbsp;object, track?: func<br>&#124;&nbsp;object }"
},
"default": "{}"
},
"slots": {
"type": {
"name": "shape",
"description": "{ input?: elementType, root?: elementType, switchBase?: elementType, thumb?: elementType, track?: elementType }"
},
"default": "{}"
},
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
},
"additionalInfo": { "sx": true }
},
"value": { "type": { "name": "any" } }
},
"name": "Switch",
"imports": [
"import Switch from '@mui/material/Switch';",
"import { Switch } from '@mui/material';"
],
"slots": [
{
"name": "root",
"description": "The component that renders the root slot.",
"default": "'span'",
"class": "MuiSwitch-root"
},
{
"name": "track",
"description": "The component that renders the track slot.",
"default": "'span'",
"class": "MuiSwitch-track"
},
{
"name": "thumb",
"description": "The component that renders the thumb slot.",
"default": "'span'",
"class": "MuiSwitch-thumb"
},
{
"name": "switchBase",
"description": "The component that renders the switchBase slot.",
"default": "SwitchBase",
"class": "MuiSwitch-switchBase"
},
{
"name": "input",
"description": "The component that renders the switchBase's input slot.",
"default": "SwitchBaseInput",
"class": "MuiSwitch-input"
}
],
"classes": [
{
"key": "checked",
"className": "Mui-checked",
"description": "State class applied to the internal `SwitchBase` component's `checked` class.",
"isGlobal": true
},
{
"key": "colorPrimary",
"className": "MuiSwitch-colorPrimary",
"description": "Styles applied to the internal SwitchBase component's root element if `color=\"primary\"`.",
"isGlobal": false
},
{
"key": "colorSecondary",
"className": "MuiSwitch-colorSecondary",
"description": "Styles applied to the internal SwitchBase component's root element if `color=\"secondary\"`.",
"isGlobal": false
},
{
"key": "disabled",
"className": "Mui-disabled",
"description": "State class applied to the internal SwitchBase component's disabled class.",
"isGlobal": true
},
{
"key": "edgeEnd",
"className": "MuiSwitch-edgeEnd",
"description": "Styles applied to the root element if `edge=\"end\"`.",
"isGlobal": false
},
{
"key": "edgeStart",
"className": "MuiSwitch-edgeStart",
"description": "Styles applied to the root element if `edge=\"start\"`.",
"isGlobal": false
},
{
"key": "sizeMedium",
"className": "MuiSwitch-sizeMedium",
"description": "Styles applied to the root element if `size=\"medium\"`.",
"isGlobal": false
},
{
"key": "sizeSmall",
"className": "MuiSwitch-sizeSmall",
"description": "Styles applied to the root element if `size=\"small\"`.",
"isGlobal": false
}
],
"spread": true,
"themeDefaultProps": false,
"muiName": "MuiSwitch",
"forwardsRefTo": "HTMLSpanElement",
"filename": "/packages/mui-material/src/Switch/Switch.js",
"inheritance": { "component": "IconButton", "pathname": "/material-ui/api/icon-button/" },
"demos": "<ul><li><a href=\"/material-ui/react-switch/\">Switch</a></li>\n<li><a href=\"/material-ui/react-transfer-list/\">Transfer List</a></li></ul>",
"cssComponent": false
}