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']arrow-up-rightcomponent props. Because of this, you can use all of the native props. This is a required children.

triangle-exclamation
Props
Type
Required

defaultChecked

boolean

❌

checked

boolean

❌

isDisabled

boolean

❌

isIndeterminate

boolean

❌

hasError

boolean

❌

onChange

(e: React.ChangeEvent) => void

❌

chevron-rightdefaultCheckedhashtag

This prop is used when using and uncontrolled approach of the component, passing a defaultValue to set the initial state.

chevron-rightcheckedhashtag

Prop that controls the checked state of the component.

chevron-rightisDisabled, isIndeterminate, hasErrorhashtag

isDisabled makes the checkbox have a disabled state, isIndeterminate makes the Checkbox partially checked and thehasError indicates an invalid value.

Label

triangle-exclamation

Label API

This subcomponent extends the native label props.

Props
Type
Required

children

ReactNode

❌

isDisabled

boolean

❌

hasError

boolean

❌

Last updated