shadcn-vue/apps/www/src/content/docs/components/toggle.md
2024-11-22 17:58:53 +08:00

1.1 KiB

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

Installation

npx shadcn-vue@latest add toggle

<template #Manual>

Install the following dependencies:

npm install reka-ui

Copy and paste the following code into your project

<<< @/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