ToggleSwitch

A checkbox input styled to look like a sliding on/off switch.

Current styles support a single toggle switch with or without a label. The case for not including a label is if the label is added and connected with the input via the for attribute elsewhere (like a future Field component). If you're just using this component by itself, you should include a label.

v-model value will be boolean.

Demos

Default

Toggle switch value: false

With label

Here are the details

Disabled, off

Disabled, on

Disabled, with label

Usage

Props

Prop nameDescriptionTypeValuesDefault
modelValueValue provided by v-model in a parent component.

Rather than directly binding a value prop to this component, use
v-model on this component in the parent component.
modelValueProp-
inputValueHTML "value" attribute to assign to the input.

Required for input groups.
string|number|boolean-false
disabledWhether the disabled attribute should be added to the input.boolean-

Events

Event namePropertiesDescription
update:modelValue

Slots

NameDescriptionBindings
defaultInput label content

Last updated: