---
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
---
## Preview
## Installation
CLI
Manual
```bash
npx @olyx/cli@latest add 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.
| Prop | Type | Default |
| --------- | -------------------------- | ----------- |
| `variant` | `"primary" \| "ghost"` | `"primary"` |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
All props from [Base UI Toggle](https://base-ui.com/react/components/toggle#api-reference) are also supported.
## Examples
### Ghost
### With Icon
### Small
### Large
### Disabled