79 lines
1.5 KiB
Plaintext
79 lines
1.5 KiB
Plaintext
---
|
|
title: Sonner
|
|
description: A beautiful toast component that can grab audience attention from any place.
|
|
lastUpdated: 09 Sep, 2025
|
|
links:
|
|
api_reference: https://sonner.emilkowal.ski/toast#api-reference
|
|
source: https://github.com/logging-studio/RetroUI/blob/main/components/retroui/Sonner.tsx
|
|
---
|
|
|
|
<ComponentShowcase name="sonner-style-default" />
|
|
<br />
|
|
<br />
|
|
|
|
## About
|
|
|
|
[Sonner](https://sonner.emilkowal.ski) is built and maintained by [Emil Kowalski](https://x.com/emilkowalski_)
|
|
|
|
<br />
|
|
<br />
|
|
|
|
## Installation
|
|
|
|
<ComponentInstall>
|
|
<ComponentInstall.Cli npmCommand="npx shadcn@latest add @retroui/sonner" />
|
|
<ComponentInstall.Manual>
|
|
#### 1. Install dependencies:
|
|
|
|
```sh
|
|
npm install sonner
|
|
```
|
|
|
|
<br />
|
|
#### 2. Copy the code 👇 into your project:
|
|
|
|
<ComponentSource name="sonner" />
|
|
|
|
<br/>
|
|
### 3. Add ``Toaster`` in your ``app/layout.tsx``
|
|
|
|
```tsx
|
|
import { Toaster } from "@/components/retroui/sonner"
|
|
|
|
export default function RootLayout({ children }) {
|
|
return (
|
|
<html lang="en">
|
|
<head />
|
|
<body>
|
|
<main>{children}</main>
|
|
<Toaster />
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|
|
```
|
|
</ComponentInstall.Manual>
|
|
|
|
</ComponentInstall>
|
|
|
|
<br />
|
|
<br />
|
|
|
|
## Examples
|
|
|
|
### Default
|
|
|
|
<ComponentShowcase name="sonner-style-default" />
|
|
<br />
|
|
<br />
|
|
|
|
### Status
|
|
|
|
<ComponentShowcase name="sonner-style-status" />
|
|
<br />
|
|
<br />
|
|
|
|
### Colored Status
|
|
|
|
<ComponentShowcase name="sonner-style-colored-status" />
|