Skip to content
Ballpoint

Sonner

shadcn's Sonner, by its name: Ballpoint's Toast, with the same toast() calls. Add either one.

From shadcn/ui
Built on Base UI Toast

Installation

pnpm dlx shadcn@latest add @ballpoint/sonner

Usage

tsx
import { Toaster, toast } from "@/components/ui/sonner"

// Once, near the root of the app:
<Toaster />

// Anywhere:
toast.success("Saved to your notebook")

Examples

From a promise

toast.promise follows a promise through loading, success and error.

With an action

A note with a button to take the action back.

  • Dear Ada
  • Shopping list
  • Sketch of a lake
  • Recipe

API reference

Toaster
component

Render it once. It draws the notes, stacked, in a corner; see Toast for its props.

toast(title, options)
function

Raises a note. toast.success, .error, .warning, .info, .loading, .promise and .dismiss work as they do in sonner.

Every other prop goes to Base UI's Toast.