diff --git a/docs/pages/api-docs/switch.md b/docs/pages/api-docs/switch.md index 953aaa1a7228ce..5fd4ffcc34728e 100644 --- a/docs/pages/api-docs/switch.md +++ b/docs/pages/api-docs/switch.md @@ -39,7 +39,7 @@ The `MuiSwitch` name can be used for providing [default props](/customization/gl | id | string | | The id of the `input` element. | | inputProps | object | | [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. | | inputRef | ref | | Pass a ref to the `input` element. | -| onChange | func | | Callback fired when the state is changed.

**Signature:**
`function(event: object) => void`
*event:* The event source of the callback. You can pull out the new value by accessing `event.target.value` (string). You can pull out the new checked state by accessing `event.target.checked` (boolean). | +| onChange | func | | Callback fired when the state is changed.

**Signature:**
`function(event: object, checked: boolean) => void`
*event:* The event source of the callback.
*checked:* The new checked state after the change. You can pull out the new value by accessing `event.target.value` (string). You can pull out the new checked state by accessing `event.target.checked` (boolean). | | required | bool | | If `true`, the `input` element will be required. | | size | 'medium'
| 'small'
| 'medium' | The size of the switch. `small` is equivalent to the dense switch styling. | | value | any | | The value of the component. The DOM API casts this to a string. The browser uses "on" as the default value. | diff --git a/packages/material-ui/src/Switch/Switch.js b/packages/material-ui/src/Switch/Switch.js index 49b4a71f5f4830..5c87a8dcd7ece6 100644 --- a/packages/material-ui/src/Switch/Switch.js +++ b/packages/material-ui/src/Switch/Switch.js @@ -253,6 +253,8 @@ Switch.propTypes = { * Callback fired when the state is changed. * * @param {object} event The event source of the callback. + * @param {boolean} checked The new checked state after the change. + * * You can pull out the new value by accessing `event.target.value` (string). * You can pull out the new checked state by accessing `event.target.checked` (boolean). */