Vue Switch Component API

Switch API

Explore the API reference for the Vue Switch component and discover how to effectively utilize its props for customization.

On this page

CFormSwitch

jsx
import { CFormSwitch } from '@coreui/vue-pro'

Props

PropertyDefaultType
id-string

The id global attribute defines an identifier (ID) that must be unique in the whole document

invalid-boolean

Set component validation state to invalid.

label-string

The element represents a caption for a component.

modelValue-boolean, string

The default name for a value passed using v-model.

reverse4.8.0+-boolean

Put checkboxes or radios on the opposite side.

size-string

Size the component large or extra large. Works only with switch.

type'checkbox'string

Specifies the type of component.

valid-boolean

Set component validation state to valid.

Events

Event name
change

Event occurs when the checked value has been changed.

update:modelValue

Emit the new value whenever there’s a change event.