# Sonner

> Toast notifications — mount `<Toaster />` once, then call `toast()` anywhere.

_Updated: 2026-06-04_

Toast notifications — mount `<Toaster />` once, then call `toast()` anywhere.

## Installation

```bash
railbase ui add sonner
```

Peer dependencies:

```bash
npm install @preact/signals
```

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

## Usage

```tsx
import { Toaster } from "@/lib/ui/sonner";

// app root:
<Toaster />

// anywhere:
toast("Saved");
toast.error("Something went wrong");
```

## Anatomy

Exported parts: `dismissToast` · `toast` · `Toaster`
