For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
43
Sponsor

Sonner

An opinionated toast component for React.

"use client";

import { toast } from "sonner";

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

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.com/r/sonner.json

Usage

import { Toaster } from "@/components/ui/sonner/sonner";
import { toast } from "sonner";
// Add <Toaster /> to your root layout, then:
toast("Event has been created");

Examples

Types

"use client";

import { toast } from "sonner";

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

Description

"use client";

import { toast } from "sonner";

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

Position

"use client";

import { toast } from "sonner";

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

RTL

To enable right-to-left support, see the RTL guide.

"use client";

import { toast } from "sonner";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";

API Reference

See the Sonner documentation for the full API reference.