Command Palette

Search for a command...

Sonner

An opinionated toast component for React.

"use client";

import { toast } from "sonner";
import { Button } from "@/components/ui/button";

export default function SonnerDemo() {
  return (
    <Button
      variant="outline"
      onClick={() =>
        toast("Event has been created", {
          description: "Sunday, December 03, 2023 at 9:00 AM",
          action: {
            label: "Undo",
            onClick: () => console.log("Undo"),
          },
        })
      }
    >
      Show Toast
    </Button>
  );
}

About

Sonner is built and maintained by emilkowalski_.

Installation

npx nore-ui-cli@latest add sonner

Usage

import { toast } from "sonner";
toast("Event has been created.");