---
title: Toggle
description: A two-state button that can be toggled on or off.
links:
doc: https://base-ui.com/react/components/toggle#api-reference
---
## Installation
CLI
Manual
```bash
npx shadcn@latest add @coss/toggle
```
Install the following dependencies:
```bash
npm install @base-ui/react
```
Copy and paste the following code into your project.
Update the import paths to match your project setup.
## Usage
```tsx
import { Toggle } from "@/components/ui/toggle"
```
```tsx
Toggle
```
## API Reference
### Toggle
Styled wrapper for `Toggle.Root` from Base UI with variant and size options.
| Prop | Type | Default | Description |
| --------- | ----------------------------- | ----------- | ------------------------------------------------ |
| `variant` | `"default" \| "outline"` | `"default"` | Controls the toggle styling |
| `size` | `"default" \| "sm" \| "lg"` | `"default"` | Controls the toggle size |
## Examples
### Outline
### With Icon
### Small Size
### Large Size
### Disabled
### Icon Group