---
title: Toggle
description: A two-state button that can be either on or off.
source: apps/www/src/lib/registry/default/ui/toggle
primitive: https://www.radix-vue.com/components/toggle.html
---
## Installation
```bash
npx shadcn-vue@latest add toggle
```
### Install the following dependencies:
```bash
npm install radix-vue
npm install --save-dev @iconify/vue
```
### Copy and paste the following code into your project
```vue
```
### Update `tailwind.config.js`
Add the following code into your `tailwind.config.js` file:
```ts
const { blackA, green, grass, mauve } = require('@radix-ui/colors')
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./**/*.vue'],
theme: {
extend: {
colors: {
...blackA,
...green,
...grass,
...mauve,
},
},
},
plugins: [],
}
```
## Usage
```vue
Toggle
```