Files
react-test/docs/pages/joy-ui/api/switch.json
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

212 lines
6.8 KiB
JSON

{
"props": {
"checked": { "type": { "name": "bool" } },
"color": {
"type": {
"name": "union",
"description": "'danger'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'success'<br>&#124;&nbsp;'warning'<br>&#124;&nbsp;string"
},
"default": "'neutral'",
"additionalInfo": { "joy-color": true }
},
"component": { "type": { "name": "elementType" } },
"defaultChecked": { "type": { "name": "bool" } },
"disabled": { "type": { "name": "bool" } },
"endDecorator": { "type": { "name": "union", "description": "node<br>&#124;&nbsp;func" } },
"onChange": {
"type": { "name": "func" },
"signature": {
"type": "function(event: React.ChangeEvent<HTMLInputElement>) => void",
"describedArgs": ["event"]
}
},
"readOnly": { "type": { "name": "bool" } },
"required": { "type": { "name": "bool" } },
"size": {
"type": {
"name": "union",
"description": "'sm'<br>&#124;&nbsp;'md'<br>&#124;&nbsp;'lg'<br>&#124;&nbsp;string"
},
"default": "'md'",
"additionalInfo": { "joy-size": true }
},
"slotProps": {
"type": {
"name": "shape",
"description": "{ action?: func<br>&#124;&nbsp;object, endDecorator?: func<br>&#124;&nbsp;object, input?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object, startDecorator?: func<br>&#124;&nbsp;object, thumb?: func<br>&#124;&nbsp;object, track?: func<br>&#124;&nbsp;object }"
},
"default": "{}"
},
"slots": {
"type": {
"name": "shape",
"description": "{ action?: elementType, endDecorator?: elementType, input?: elementType, root?: elementType, startDecorator?: elementType, thumb?: elementType, track?: elementType }"
},
"default": "{}",
"additionalInfo": { "slotsApi": true }
},
"startDecorator": { "type": { "name": "union", "description": "node<br>&#124;&nbsp;func" } },
"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 }
},
"variant": {
"type": {
"name": "union",
"description": "'outlined'<br>&#124;&nbsp;'plain'<br>&#124;&nbsp;'soft'<br>&#124;&nbsp;'solid'<br>&#124;&nbsp;string"
},
"default": "'solid'",
"additionalInfo": { "joy-variant": true }
}
},
"name": "Switch",
"imports": ["import Switch from '@mui/joy/Switch';", "import { Switch } from '@mui/joy';"],
"slots": [
{
"name": "root",
"description": "The component that renders the root.",
"default": "'div'",
"class": "MuiSwitch-root"
},
{
"name": "thumb",
"description": "The component that renders the thumb.",
"default": "'span'",
"class": "MuiSwitch-thumb"
},
{
"name": "action",
"description": "The component that renders the action.",
"default": "'div'",
"class": "MuiSwitch-action"
},
{
"name": "input",
"description": "The component that renders the input.",
"default": "'input'",
"class": "MuiSwitch-input"
},
{
"name": "track",
"description": "The component that renders the track.",
"default": "'span'",
"class": "MuiSwitch-track"
},
{
"name": "startDecorator",
"description": "The component that renders the start decorator.",
"default": "'span'",
"class": "MuiSwitch-startDecorator"
},
{
"name": "endDecorator",
"description": "The component that renders the end decorator.",
"default": "'span'",
"class": "MuiSwitch-endDecorator"
}
],
"classes": [
{
"key": "checked",
"className": "Mui-checked",
"description": "State class applied to the root `checked` class.",
"isGlobal": true
},
{
"key": "colorContext",
"className": "MuiSwitch-colorContext",
"description": "Class name applied to the root element when color inversion is triggered.",
"isGlobal": false
},
{
"key": "colorDanger",
"className": "MuiSwitch-colorDanger",
"description": "Class name applied to the root element if `color=\"danger\"`.",
"isGlobal": false
},
{
"key": "colorPrimary",
"className": "MuiSwitch-colorPrimary",
"description": "Class name applied to the root element if `color=\"primary\"`.",
"isGlobal": false
},
{
"key": "colorSuccess",
"className": "MuiSwitch-colorSuccess",
"description": "Class name applied to the root element if `color=\"success\"`.",
"isGlobal": false
},
{
"key": "colorWarning",
"className": "MuiSwitch-colorWarning",
"description": "Class name applied to the root element if `color=\"warning\"`.",
"isGlobal": false
},
{
"key": "disabled",
"className": "Mui-disabled",
"description": "State class applied to the root disabled class.",
"isGlobal": true
},
{
"key": "focusVisible",
"className": "Mui-focusVisible",
"description": "State class applied to the root element if the switch has visible focus",
"isGlobal": true
},
{
"key": "readOnly",
"className": "Mui-readOnly",
"description": "Class name applied to the root element if the switch is read-only",
"isGlobal": true
},
{
"key": "sizeLg",
"className": "MuiSwitch-sizeLg",
"description": "Class name applied to the root element if `size=\"lg\"`.",
"isGlobal": false
},
{
"key": "sizeMd",
"className": "MuiSwitch-sizeMd",
"description": "Class name applied to the root element if `size=\"md\"`.",
"isGlobal": false
},
{
"key": "sizeSm",
"className": "MuiSwitch-sizeSm",
"description": "Class name applied to the root element if `size=\"sm\"`.",
"isGlobal": false
},
{
"key": "variantOutlined",
"className": "MuiSwitch-variantOutlined",
"description": "Class name applied to the root element if `variant=\"outlined\"`.",
"isGlobal": false
},
{
"key": "variantSoft",
"className": "MuiSwitch-variantSoft",
"description": "Class name applied to the root element if `variant=\"soft\"`.",
"isGlobal": false
},
{
"key": "variantSolid",
"className": "MuiSwitch-variantSolid",
"description": "Class name applied to the root element if `variant=\"solid\"`.",
"isGlobal": false
}
],
"spread": true,
"themeDefaultProps": true,
"muiName": "JoySwitch",
"forwardsRefTo": "HTMLDivElement",
"filename": "/packages/mui-joy/src/Switch/Switch.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/joy-ui/react-switch/\">Switch</a></li></ul>",
"cssComponent": false
}