Extensions

Press shift + S to search API reference.

React component

SwitchSynced

View source

Props

interface SwitchSyncedProps extends SharedSwitchProps
aria-describedbyundefined | string

A space separated list of description element IDs.

aria-labelundefined | string

The label for the switch. Use this if the switch lacks a visible text label.

aria-labelledbyundefined | string

A space separated list of label element IDs.

classNameundefined | string

Additional class names to apply to the switch.

disabledundefined | false | true

If set to true, the user cannot interact with the switch.

globalConfigKeyGlobalConfigKey

A string key or array key path in GlobalConfig. The switch option will always reflect the boolean value stored in globalConfig for this key. Toggling the switch will update globalConfig.

idundefined | string

The ID of the switch element.

labelReact.ReactNode | string

The label node for the switch.

onChangeundefined | function (newValue: boolean) => unknown

A function to be called when the switch is toggled.

sizeControlSizeProp

The size of the switch. Defaults to default.

styleReact.CSSProperties

Additional styles to apply to the switch.

tabIndexundefined | number

Indicates if the switch can be focused and if/where it participates in sequential keyboard navigation.

variantSwitchVariant

The variant of the switch. Defaults to default (green).