shadcn-vue/apps/www/src/content/docs/components/toggle.md
2024-03-20 22:23:28 +03:30

1.1 KiB

title description source primitive
Toggle A two-state button that can be either on or off. apps/www/src/lib/registry/default/ui/toggle https://www.radix-vue.com/components/toggle.html

Installation

npx shadcn-vue@latest add toggle

<template #Manual>

Install the following dependencies:

npm install radix-vue

Copy and paste the following code into your project

<<< @/lib/registry/default/ui/toggle/Toggle.vue

Usage

<script setup lang="ts">
import { Toggle } from '@/components/ui/toggle'
</script>

<template>
  <Toggle>Toggle</Toggle>
</template>

Examples

Default

Outline

With Text

Small

Large

Disabled