Components

A brief, dismissible message that provides feedback about an action.

Notification

This is a default toast.

Notification

This is a brand toast.

Notification

This is a success toast.

Notification

This is a warning toast.

Notification

This is a danger toast.

Installation

npm install @mijn-ui/react-toast
import { Toast } from "@mijn-ui/react-toast"
<Toast
  intent="success"
  title="Saved"
  description="Your changes have been saved."
  onClose={() => {}}
/>
Note:

Toast is a presentational component — render it yourself and control its lifecycle (position, queue, timeout) with your own state or a toast manager.


API Reference

PropTypeDefaultDescription
intent"default" | "brand" | "success" | "warning" | "danger""default"Color scheme of the toast.
titleReactNodeThe toast title.
descriptionReactNodeThe toast description.
iconReactNodeLeading icon.
actionReactNodeAn action element (e.g. an undo button).
onClose() => voidCalled when the close button is clicked. Renders the close button when provided.
unstyledbooleanfalseOpt out of the default styles.
classNamesobjectOverride classes per slot (see Style Slots below).
classNamestringAdditional classes for the root element.

Toast Style Slots

Slot NameTargeted ComponentPurpose
baseToastStyles the root toast container.
iconToastStyles the leading icon wrapper.
bodyToastStyles the title/description wrapper.
titleToastStyles the toast title.
descriptionToastStyles the toast description.
actionToastStyles the action element.
closeToastStyles the close button.