ToggleSwitch

UX

View Source

ToggleSwitches are used to switch between two states, most commonly on and off, and visually show the current state.

Props

Themeable

Use the toggleSwitch key in ThemeProvider to customize the default properties of this component.

ariaLabelstring

The aria label for the toggle.

The color of the toggle background when it is active.

disabledboolean

Whether the toggle is disabled.

isCheckedboolean

Whether the toggle is checked.

labelstring

The label for the toggle.

labelPosition'before' | 'after'
onClick() => void

The function to call when the toggle is clicked.

size'xs' | 'sm' | 'md'

The size of the toggle.

tooltipstring

The tooltip to display when the toggle is hovered.