# Switch

> An on/off toggle.

_Updated: 2026-06-04_

An on/off toggle.

## Installation

```bash
railbase ui add switch
```

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

## Usage

```tsx
import { Switch } from "@/lib/ui/switch";

const [on, setOn] = useState(false);

<Switch checked={on} onCheckedChange={setOn} />
```
