Switch

Slidable button that toggles between two-states.

Import

JSX

Usage

JSX

Variants

Label

Notifications
JSX

Description

Notifications

Receive emails about the latest updates.

JSX

Icons

Dark mode
JSX

Initial value

Notifications

Receive emails about the latest updates.

JSX

Disabled

Notifications

Receive emails about the latest updates.

JSX

Props

Switch

PropTypeDefaultDescription
isActivebooleanfalseInitial state of the switch
onActive() => Promise<void> | void-Callback function when switch is on
onDeactive() -> Promise<void> | void-Callback function when switch is off
disabledbooleanfalsePrevents the user from toggling the switch
children*JSX.Element-Expecting <Switch.Track> and if applicable <Switch.Meta>

Switch.Track

PropTypeDefaultDescription
children*JSX.Element-Expecting <Switch.Thumb>

Switch.Thumb

PropTypeDefaultDescription
childrenJSX.Element-In case of icons, children must be the icon component

Switch.Meta

PropTypeDefaultDescription
children*JSX.Element-Expecting either <Switch.Label> and/or <Switch.Description>

Switch.Label

PropTypeDefaultDescription
children*string-Title of the switch input

Switch.Description

PropTypeDefaultDescription
children*string-Extra information about the switch input
*: mandatory props