# Toggle

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

_Updated: 2026-06-04_

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

## Installation

```bash
railbase ui add toggle
```

Peer dependencies:

```bash
npm install class-variance-authority
```

> [!NOTE]
> `railbase ui add` also copies shared primitives — they ship alongside this component automatically.

## Usage

```tsx
import { Toggle } from "@/lib/ui/toggle";

<Toggle aria-label="Bold">B</Toggle>
```

## Anatomy

Exported parts: `toggleVariants` · `Toggle`
