120k

Toggle

A two-state button that can be either on or off.

Installation

pnpm dlx shadcn@latest add @force-ui-vue/toggle

Usage

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

Examples

Outline

Use variant="outline" for an outline style.

With Text

Size

Use the size prop to change the size of the toggle.

Disabled

API Reference

See the Radix Toggle documentation.