Skip to content
Theme:

Ui3nSwitch

Switch component for toggling boolean values.

Props

NameTypeDefaultDescription
idstring | undefined

Root element id

namestring | undefined

HTML name attribute for form submission

modelValue*boolean

Current switch value

sizestring | number | undefined16

Switch size

colorstring | undefined"var(--color-icon-control-accent-default)"

Switch color

disabledboolean | undefinedfalse

Whether switch is disabled

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: boolean
changevalue: boolean

Slots

Slot NameScope Props (v-slot)Description
#default

Default slot

Public Methods & Exposes

Method NameSignature / TypeDescription
clear()() => void

Usage Examples

Simple switch

Simple switch

Basic switch toggle

Switch with label

Switch with label

Switch with label using default slot

Customized switch

Customized switch

Switch with custom size and color