Skip to content
Pixelbits
Docs / Toast
Overlays

Toast

The place where toasts appear. Mount it once, near the root of the app. It is a polite live region, so screen readers announce new toasts without interrupting, and it sits in the top layer (above open dialogs).

Installation

npm: import
import { Toaster, toast } from "pixelbits/toast";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/toast.json

API

<Toaster>

The place where toasts appear. Mount it once, near the root of the app. It is a polite live region, so screen readers announce new toasts without interrupting, and it sits in the top layer (above open dialogs).

Example
<Toaster position="bottom-end" />
PropTypeDefaultDescription
position"top-start" | "top-end" | "bottom-start" | "bottom-end""bottom-end"

Corner where toasts stack. start/end follow the text direction.

maxnumber3

Most toasts visible at once; older ones are hidden first.

classNamestring—

Extra classes for the toast list.