import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { ToastCentre } from './toast-centre.component';

<Meta title="Core/Overlays/ToastCentre" component={ToastCentre} />

# ToastCentre

The `<ToastCentre />` takes a list of `messages` with the following shape:

- `text` (required): text to be displayed
- `onClose` callback: will be fired after the toast is closed
- `id`: the argument passed when calling the `onClose` callback
- `timerDelay` (default: 5000): custom time in milliseconds to dismiss the toast
- `level`: one of info, success, or error

## Default

<Canvas withToolbar>
  <Story id="core-overlays-toastcentre--default" />
</Canvas>

## Custom Delay

<Canvas withToolbar>
  <Story id="core-overlays-toastcentre--toast-centre-with-custom-delay" />
</Canvas>
