docs / core / toast

Toast

a brief message that announces something just happened. mount Toaster once, then fire toast() from anywhere, even outside React.

intensity · recedesrsc · client

provenance

shaped from sisu-plus

layer

core / primitives

intensity

recedes · safe anywhere, including dense surfaces

composition

Toaster mounts once in the root layout, the viewport portals itselffire from event handlers, async callbacks, non-React modulesnever two Toasters. two viewports means every toast twicenot for form errors. those belong inline, next to the field

a11y

the close button is labelled Dismiss · icons, dots and the countdown bar are aria-hidden · swipe down or right to dismissjest-axe

dependencies

@base-ui/react
live demo · try it out

toast() options

proptypedefaultnotes
titleReactNodethe headline. the only required field.
descriptionReactNodesupporting copy under the title.
type"success" | "warning" | "danger" | "info"the status icon, dot and tint. untyped toasts render plain.
durationnumberauto-dismiss in ms, drawn as a countdown bar. 0 disables it, for toasts that need a decision.
action{ label: string; onClick?: () => void }one inline action button. more than that is a Dialog.

Toaster

proptypedefaultnotes
limitnumberhow many toasts stack before the oldest collapses.
timeoutnumberthe default duration for toasts that do not set their own.

get it

bun add @usva-ui/reactcopy
usagecopy
import { notify, toast, Toaster } from "@usva-ui/react/primitives/toast";

<Toaster />

toast({ title: "Saved", description: "Your changes are live.", type: "success" });
notify.error("Upload failed");