aria-label | string | undefined | Adds an accessible name to the switch when the label prop is not passed, and must describe the isChecked="true" state. |
aria-labelledby | string | undefined | Adds an accessible name to the switch via one or more referenced id(s). The computed accessible name must describe the isChecked="true" state. |
className | string | | Additional classes added to the switch |
defaultChecked | boolean | | Flag to set the default checked value of the switch when it is uncontrolled by React state.
To make the switch controlled instead use the isChecked prop, but do not use both. |
hasCheckIcon | boolean | | Flag to show if the switch has a check icon. |
id | string | | id for the label. |
isChecked | boolean | true | Flag to show if the switch is checked when it is controlled by React state.
To make the switch uncontrolled instead use the defaultChecked prop, but do not use both. |
isDisabled | boolean | false | Flag to show if the switch is disabled. |
isReversed | boolean | false | Flag to reverse the layout of toggle and label (label at start, toggle at end). |
label | React.ReactNode | | Text value for the visible label |
onChange | (event: React.FormEvent<HTMLInputElement>, checked: boolean) => void | () => undefined as any | A callback for when the switch selection changes. (event, isChecked) => {} |
ouiaId | number | string | | Value to overwrite the randomly generated data-ouia-component-id. |
ouiaSafe | boolean | | Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. |