Switch
Commonly used toggle switch.
Basic usage
Use o variants to determine component colors.
Light style
If you want to use plain style, just use set light
attribute to true
.
Custom dot color
Don't like the theme color? Provides you with the greatest possible custom color.
You can set o
variant to active color. And set background-color
attribute to unactive color.
Sizes
Besides default size, Switch component provides three additional sizes for you to choose among different scenarios.
Use attribute size
to set additional sizes with sm
,md
,lg
.
Disabled
The disabled
attribute determines if the switch is disabled.
Use disabled
attribute to determine whether a switch is disabled. It accepts a Boolean
value.
Icon Slots
TODO
Switch Props
Name | Type | Default | Description |
---|---|---|---|
modelValue / v-model | boolean | false | Binding value. |
size | 'sm' | 'md' | 'lg' | 'md' | Switch size. |
o | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'primary' | Switch type. |
light | boolean | false | Determine whether it's a light switch. |
disabled | boolean | false | Disable the switch. |
background-color | string | undefined | Custom the switch dot or background color. |