Theme:
Ui3nSwitch
Switch component for toggling boolean values.
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Root element id |
name | string | undefined | — | HTML name attribute for form submission |
modelValue* | boolean | — | Current switch value |
size | string | number | undefined | 16 | Switch size |
color | string | undefined | "var(--color-icon-control-accent-default)" | Switch color |
disabled | boolean | undefined | false | Whether switch is disabled |
Events
| Event Name | Arguments / Value Type | Description |
|---|---|---|
update:modelValue | value: boolean | — |
change | value: boolean | — |
Slots
| Slot Name | Scope Props (v-slot) | Description |
|---|---|---|
#default | — | Default slot |
Public Methods & Exposes
| Method Name | Signature / Type | Description |
|---|---|---|
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