Toggle
Toggle Buttons allow users to toggle a selection on or off, for example switching between two states or modes.
Installation
CLI
Manual
Basic
View
Code
Single Toggle Button
Variant
If you chose ghost
variant, make sure you set different text or icon for toggled an untoggled state
View
Code
Size
View
Code
Shape
View
Code
Icon
View
Code
Controlled
You can control the state of the toggle button by passing a isSelected
prop.
View
Code
{
"isSelected": false
}
Disabled
View
Code
Toggle Group
You can group multiple toggle buttons into a toggle group by wrap them in a <Toggle.Group>
.
View
Code
Orientation
You can change the orientation of the toggle group by passing an orientation
prop.
View
Code
Selection Mode
You can change the selection mode of the toggle group by passing a selectionMode
prop.
View
Code
SingleMultiple
Variant
View
Code
Controlled
You can control the state of the toggle group by passing a selectedKeys
prop.
View
Code
[
"bold"
]
Disabled
View
Code