Switch NEW

Behaves same as checkbox but UI is like a switch.

Subscribed
Unsubscribed
Light
Dark

Color

Array Value

[
  "react"
]
Vue
Vue
React
React
Angular
Angular
Svelte
Svelte

On / Off / Circle Slots

You can define specific values for on and off states using named on and off slots. default slot is used on both on and off if either of them is not specified.

cirlce slot allows setting content for example an icon on mover.

Default Slot
Default Slot
Default Slot
On/Off Slots
Light
Dark
Circle Slot

Alternative

Alternative prop changes b1 and b2 color ( background 1 and backround 2 ).

autoWidth

By default when on and off slots are not same width you can experience a transition on width, if it shows any unexpected behaviour you can set the width to auto by autoWidth boolean prop.

Props

NameTypeRequiredDefaultDescription
modelValueboolean | string | number | null | Record<string, any>YesundefinedValue of the active radio.
valuestring, numberNoundefinedUsed when v-model is array
colorstringNoundefinedThe primary color of the component.
containerClassstringNoundefinedClass(es) to be passed to content container
disabledbooleanNoundefinedIf true, disables the input element.
alternativebooleanNoundefinedReverts b1 and b2 colors.
autoWidthbooleanNoundefinedDisabled width transition.

Slots

Nameslot propsdescription
default-On and Off
on-Visible when switch is active
off-Visible when switch is deactive
circle-content of mover