Skip to content
On this page

Switch

vue
<template>
  <div>
    <Switch label="Active Switch" active />
    <Switch label="Inactive Switch" />
    <Switch label="Disabled Active Switch" disabled active />
    <Switch label="Disabled Active Switch" disabled />
  </div>
</template>
<script setup>
import Switch from "@/components/Switch";
import { ref } from "vue";
const picked1 = ref("A");
</script>

TIP

For example props: disabled", active You can also use label props for labeling text.

How can I use icon in switch?

You can use icon in switch by using prevIcon & nextIcon props.

vue
<template>
  <div>
    <Switch
      label="Active Switch"
      active
      prevIcon="fas fa-check"
      nextIcon="fas fa-times"
    />
  </div>
</template>

COPYRIGHT © 2022 Codeshaper, All rights reserved.