SubComponents
Control
The control subcomponent is required to render the Control of the Switch component. Because of this, this component extends the native input[type='checkbox']component props. Because of this, you can use all of the native props. This is a required children.
Notice that there is a difference between using isDisabled here or in the parent component. It is not recommended to change this props in the Control subcomponent, because this props can be inherited from the Wrapper. If you use it in the Control subcomponent, you will get the state only in the field.
defaultChecked
boolean
❌
checked
boolean
❌
isDisabled
boolean
❌
isIndeterminate
boolean
❌
hasError
boolean
❌
onChange
(e: React.ChangeEvent) => void
❌
Label
The label subcomponent does not extend the SDS label component.
Label API
This subcomponent extends the native label props.
children
ReactNode
❌
isDisabled
boolean
❌
hasError
boolean
❌
Last updated