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.
ariaLabel
string
The aria label for the toggle.
backgroundColor
string
The color of the toggle background when it is active.
disabled
boolean
Whether the toggle is disabled.
isChecked
boolean
Whether the toggle is checked.
label
string
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.
tooltip
string
The tooltip to display when the toggle is hovered.