Switch
Basic
Use ASwitch
component to create toggle for boolean value.
Colors
You can use color
prop to change the switch color.
Label
You can use label
prop to add label to switch component.
Label and switch have justify-between
added as this is how generally used but you can use flex classes to modify it according to your use.
TIP
You can also use default slot to render the label.
Icons
Use on-icon
& off-icon
prop to render icons inside switch dot.
Array
Just like ACheckbox
, ASwitch
also supports array.
Enabled Notifications: []
Custom model values
You can use on-value
and off-value
props to set custom v-model
value.
Sizing
You can use font-size utility to adjust the size of switch.
States
You can use disabled
prop to disable the switch.
Roundness
You can adjust switch roundness using border-radius utilities.
API
Bind v-model value
Switch color
Disable switch
Set custom value for indeterminate state
Enable cycling indeterminate state
Bind classes to input element
Define label text
Icon to render when switch is off