Toggle Switch
Toggle provide users with different selection and activation tools.
install | yarn add @clayui/form |
---|---|
version | 3.122.0 |
Stable3.122.0View in LexiconCHANGELOG
In order to create a controlled Toggle
you need to provide the toggled
and onToggle
props.
You can also have custom icons that further signal the current state of the Toggle by providing a symbol
prop.
Copied!
Code Sample (expand to see it)
Inside ClayRadioGroup
If you want the Toggle to behave like a radio element (toggling one on will toggle others off) wrap multiple Toggles
with a ClayRadioGroup component.
Copied!
Code Sample (expand to see it)
Sizing
The attribute sizing="sm"
can be used to create a smaller toggle switch.
Copied!
Code Sample (expand to see it)