Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Toast

Brief, dismissible notifications backed by a shared store.

Preview

Live preview

Changes apply to this preview only.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Persistent warning

Open a real notification, dismiss it or wait for its configured duration.

Open preview

Brief status update

Open a real notification, dismiss it or wait for its configured duration.

Open preview

Undo a local action

Archive a draft and restore it through the toast action.

Open preview

Usage

Mount one Toaster in your app and call toast with a title and optional description, tone, duration and action. toast returns an id that dismissToast can remove.

A duration of 0 keeps the toast open. Dismissal and actions should be meaningful, and an important workflow should not depend on noticing a transient notification.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluToastAction

Type source
PimoluToastAction public API
NameTypeDefaultDescription
labelRequiredReactNode"Notifications"Visible label associated with the control.
onClickRequired() => void—Public Pimolu prop; see the source declaration for details.
labelRequired

ReactNode

Default: "Notifications"

Visible label associated with the control.

onClickRequired

() => void

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluToastOptions

Type source
PimoluToastOptions public API
NameTypeDefaultDescription
titleRequiredReactNode—Public Pimolu prop; see the source declaration for details.
descriptionReactNode—Public Pimolu prop; see the source declaration for details.
variant"success" | "warning" | "danger" | "default" | undefined"default"Variant exposed by this component.
durationnumber | undefined5000Auto-dismiss delay in ms. 0 keeps the toast open. Defaults to 5000.
actionPimoluToastAction | undefined—Public Pimolu prop; see the source declaration for details.
idstring | undefined—Public Pimolu prop; see the source declaration for details.
titleRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

description

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

variant

"success" | "warning" | "danger" | "default" | undefined

Default: "default"

Variant exposed by this component.

duration

number | undefined

Default: 5000

Auto-dismiss delay in ms. 0 keeps the toast open. Defaults to 5000.

action

PimoluToastAction | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

id

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluToastItem

Type source
PimoluToastItem public API
NameTypeDefaultDescription
idRequiredstring—Public Pimolu prop; see the source declaration for details.
titleRequiredReactNode—Public Pimolu prop; see the source declaration for details.
descriptionReactNode—Public Pimolu prop; see the source declaration for details.
variant"success" | "warning" | "danger" | "default" | undefined"default"Variant exposed by this component.
durationnumber | undefined5000Auto-dismiss delay in ms. 0 keeps the toast open. Defaults to 5000.
actionPimoluToastAction | undefined—Public Pimolu prop; see the source declaration for details.
idRequired

string

No default extracted.

Public Pimolu prop; see the source declaration for details.

titleRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

description

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

variant

"success" | "warning" | "danger" | "default" | undefined

Default: "default"

Variant exposed by this component.

duration

number | undefined

Default: 5000

Auto-dismiss delay in ms. 0 keeps the toast open. Defaults to 5000.

action

PimoluToastAction | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluToasterProps

Type source
PimoluToasterProps public API
NameTypeDefaultDescription
positionPimoluToastPosition | undefined"top-right"Public Pimolu prop; see the source declaration for details.
labelstring | undefined"Notifications"Accessible name of the live region.
position

PimoluToastPosition | undefined

Default: "top-right"

Public Pimolu prop; see the source declaration for details.

label

string | undefined

Default: "Notifications"

Accessible name of the live region.

Accessibility

  • Toaster provides a named live region; avoid mounting several for the same store.
  • Keep a persistent way to find important feedback. Allow enough time to read the message and operate any action.
Read the accessibility guide →