Components

BaseSwitch

An on/off switch with a text and an optional description, for settings that apply at once.

components/ui/inputs/BaseSwitch.vue
View in the demo

Example

API

It also accepts every prop, slot and event of v-switch, which it passes through.

Props

Name
Type
Default
Description
textstring—The text next to the switch.
descriptionstring—A second line that explains the setting.
labelstring—The visible label above the field, linked to it with for and aria-labelledby.
input-idstring—A fixed id for the input. One is generated with useId() when you leave it out.
optionalboolean—Adds “(optional)” after the label. Never mark required fields.
infoBaseInputInfo—A help popover next to the label: a text or a list of { title, text }.
v-modelbooleanfalseWhether it is on.

Events

Name
Payload
Description
@update:modelValue[value: boolean]—

Accessibility

Use a switch for settings that take effect immediately and a checkbox for choices confirmed with a submit button.

© 2026 melsami UI.
Developer documentation for melsami UI.