Skip to content
On this page

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

NameTypeDefaultDescription
modelValue / v-modelbooleanfalseBinding value.
size 'sm' | 'md' | 'lg''md'Switch size.
o'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info''primary'Switch type.
lightbooleanfalseDetermine whether it's a light switch.
disabledbooleanfalseDisable the switch.
background-colorstringundefinedCustom the switch dot or background color.

MIT Licensed