Skip to content

Switch

Boolean switch with keyboard support.

Usage

vue
<script setup>
import { ref } from "vue";
import { ArchSwitch } from "@archora/ui";

const enabled = ref(true);
</script>

<template>
  <ArchSwitch v-model="enabled">Auto deploy</ArchSwitch>
</template>

Live sandbox

Switch can be tested directly on this page.

interactive
<Switch />

Props

PropTypeDefaultDescription
modelValuebooleanfalsev-model value.
labelstring-Accessible label or text.
disabledbooleanfalseDisables the component.
requiredbooleanfalseMarks the field as required.
invalidbooleanfalseInvalid state.
ariaLabelstring-aria-label.
ariaLabelledbystring-aria-labelledby.
ariaDescribedbystring-aria-describedby.

Events

EventPayloadDescription
update:modelValuevalue: booleanmodelValue change.
changevalue: booleanValue change.

Slots

SlotPropsDescription
default-Switch label.