MigsLab UIVue 3 component workshop

Form

Checkbox & Switch

Boolean inputs. Use a checkbox for choices that are submitted with a form, and a switch for settings that apply immediately.

import { CheckboxComponent, SwitchToggleComponent } from '@/MigsLab/shared'

Checkbox

Checked: false
<CheckboxComponent v-model="isTermsAccepted">Accept terms and conditions</CheckboxComponent>

Switch

On: true
<SwitchToggleComponent v-model="isNotificationOn">Email notifications</SwitchToggleComponent>

API

Props (both components)

NameType Default Description
v-modelbooleanfalseChecked / on state.
disabledbooleanfalseDisable the control.

Slots

NameDescription
defaultLabel text.