Toast

Playground

Properties

Icon

Content

Title
Description

Usage

Add ToastProvider once in your app. Call showToast to add a notification, then pass its returned identifier to dismissToast to close it. Call dismissToast without an argument to close all notifications. Keep important results available on the page after a toast disappears.

'use client';
import { ToastProvider, showToast, Button } from '@mbsw/ui';

export default function Example() {
  return (
    <>
      <ToastProvider containerLabel={"Notification"} />
      <Button
        onClick={() =>
          showToast({
            title: 'Title',
            description: 'Description',
            closeLabel: "Close notification",
          })
        }
      >
        open
      </Button>
    </>
  );
}

The Playground Code tab includes the full example with your current settings. See Installation for the CSS imports.

Composition