Switch

A compact toggle control for boolean settings.

Installation

npx alixan-ui-nuxt add switch

Usage

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

PropTypeDefaultDescription
modelValuebooleanfalseSelected state used by v-model.
labelstring-Optional label rendered next to the switch.
disabledbooleanfalseDisables switch interaction.