Railbase
GPTClaude

Toaster

The toast host/region. Mount once; trigger with `toast()`.

Updated

Trigger a toast
// Toaster re-exports from sonner. Mount once at the app root:
<Toaster />

<Button variant="outline" onClick={() => toast("Profile saved")}>Show toast</Button>

The toast host/region. Mount once; trigger with toast().

Installation

railbase ui add toaster

Note

railbase ui add also copies the sonner component — they ship alongside this component automatically.

Usage

import { Toaster } from "@/lib/ui/toaster";

// app root:
<Toaster />

// anywhere:
toast("Done");

Anatomy

Exported parts: Toaster · toast · dismissToast