Switch
A compact toggle control for boolean settings.
Installation
npx alixan-ui-nuxt add switchUsage
Use v-model to bind the boolean state.
<script setup lang="ts">
const checked = ref(false)
</script>
<template>
<Switch v-model="checked" label="Airplane Mode" />
<Switch v-model="disabledChecked" label="Disabled" disabled />
</template>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| modelValue | boolean | false | Selected state used by v-model. |
| label | string | - | Optional label rendered next to the switch. |
| disabled | boolean | false | Disables switch interaction. |