Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Sonner

An opinionated toast component.

Installation

npx logic2b@latest add sonner

Usage

Add the Toaster component once, then call toast() from anywhere.

import { Toaster } from "@/components/ui/sonner"

<Toaster />
import { toast } from "sonner"

toast("Event has been created")

API

The Toaster component wraps sonner’s Toaster and forwards every ToasterProps. Toasts themselves are created imperatively with toast().

Prop Type Default
theme light | dark | system system
position top-left | top-center | top-right | bottom-left | bottom-center | bottom-right bottom-right
richColors boolean false
closeButton boolean false
expand boolean false
duration number (ms) 4000

Examples

With an action

Promise