Skip to content
FeedbackInteractive playground

Toaster

Brief notifications that accompany an action.

Preparing the playground…
Text and Markdown example
Toaster · Example
1<><Toaster /><Button onClick={() => toast.success("Project saved")}>Show notification</Button></>
Read documentation in Markdown

How to use it

Mount one Toaster in your application and call toast from event handlers. Do not use toasts as the only place for errors that require correction.

Import

React / Next.js
1import { Toaster } from "@kivora/nextjs";

Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.

API reference 0.2.0

Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.

PropertyTypeDescription
classNamestringAdditional CSS classes to customize the element.
closeButtonbooleanConfigures closeButton. The type describes the supported values and structure.
containerAriaLabelstringConfigures containerAriaLabel. The type describes the supported values and structure.
customAriaLabelstringConfigures customAriaLabel. The type describes the supported values and structure.
dir"auto" | "ltr" | "rtl"Interface reading direction.
durationnumberConfigures duration. The type describes the supported values and structure.
expandbooleanConfigures expand. The type describes the supported values and structure.
gapnumberConfigures gap. The type describes the supported values and structure.
hotkeystring[]Configures hotkey. The type describes the supported values and structure.
iconsToastIconsConfigures icons. The type describes the supported values and structure.
idstringElement identifier; associates labels and descriptions.
invertbooleanConfigures invert. The type describes the supported values and structure.
mobileOffsetOffsetConfigures mobileOffset. The type describes the supported values and structure.
offsetOffsetConfigures offset. The type describes the supported values and structure.
position"top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center"Configures position. The type describes the supported values and structure.
richColorsbooleanConfigures richColors. The type describes the supported values and structure.
styleCSSPropertiesReact inline styles.
swipeDirectionsSwipeDirection[]Configures swipeDirections. The type describes the supported values and structure.
theme"light" | "dark" | "system"Component theme or theme identifier, depending on the API.
toastOptionsToastOptionsConfigures toastOptions. The type describes the supported values and structure.
visibleToastsnumberConfigures visibleToasts. The type describes the supported values and structure.

TypeScript definition

Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.

Toaster21 properties
Toaster · TypeScript
1declare function Toaster({ className, toastOptions, ...props }: ToasterProps): React.JSX.Element;
API generated from @kivora/nextjs 0.2.0View package