ToggleSwitch
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
stringThe aria label for the toggle.
backgroundColor
stringThe color of the toggle background when it is active.
disabled
booleanWhether the toggle is disabled.
id
stringThe ID of the toggle.
isChecked
booleanWhether the toggle is checked.
label
stringThe label for the toggle.
labelPosition
'before' | 'after'The position of the toggle label.
onClick
() => voidThe function to call when the toggle is clicked.
size
'xs' | 'sm' | 'md'The size of the toggle.
tooltip
stringThe tooltip to display when the toggle is hovered.