# toast

```ts
import { ToastModule } from '@anguless/angulux/toast';
```

## ToastItem

`agl-toastItem` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `message` | `ToastMessageOptions \| null \| undefined` | _not documented_ |  |
| `index` | `number \| null \| undefined` | _not documented_ |  |
| `life` | `number` | _not documented_ |  |
| `template` | `TemplateRef<ToastMessageTemplateContext> \| undefined` | _not documented_ |  |
| `headlessTemplate` | `TemplateRef<ToastHeadlessTemplateContext> \| undefined` | _not documented_ |  |
| `showTransformOptions` | `string \| undefined` | _not documented_ |  |
| `hideTransformOptions` | `string \| undefined` | _not documented_ |  |
| `showTransitionOptions` | `string \| undefined` | _not documented_ |  |
| `hideTransitionOptions` | `string \| undefined` | _not documented_ |  |
| `motionOptions` | `MotionOptions` | _not documented_ |  |
| `clearAll` | `any` | _not documented_ |  |

| Output | Type | Description |
| --- | --- | --- |
| `onAnimationStart` | `HTMLElement` |  |
| `onAnimationEnd` | `HTMLElement` |  |
| `onClose` | `EventEmitter<ToastItemCloseEvent>` |  |

## Toast

`agl-toast` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

Toast is used to display messages in an overlay.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `key` | `string \| undefined` | _not documented_ | Key of the message in case message is targeted to a specific toast component. |
| `autoZIndex` | `boolean` | _not documented_ | Whether to automatically manage layering. |
| `baseZIndex` | `number` | _not documented_ | Base zIndex value to use in layering. |
| `life` | `number` | _not documented_ | The default time to display messages for in milliseconds.  The pointer over a message, or keyboard focus in it, pauses its timer; once both have left, the message gets its full time again. |
| `styleClass` | `string \| undefined` | _not documented_ | Inline class of the component. **Deprecated:** since v20.0.0, use `class` instead. |
| `position` | `ToastPositionType` | _not documented_ | Position of the toast in viewport. |
| `preventOpenDuplicates` | `boolean` | _not documented_ | It does not add the new message if there is already a toast displayed with the same content |
| `preventDuplicates` | `boolean` | _not documented_ | Displays only once a message with the same content. |
| `showTransformOptions` | `string` | _not documented_ | Transform options of the show animation. **Deprecated:** since v21.0.0. Use `motionOptions` instead. |
| `hideTransformOptions` | `string` | _not documented_ | Transform options of the hide animation. **Deprecated:** since v21.0.0. Use `motionOptions` instead. |
| `showTransitionOptions` | `string` | _not documented_ | Transition options of the show animation. **Deprecated:** since v21.0.0. Use `motionOptions` instead. |
| `hideTransitionOptions` | `string` | _not documented_ | Transition options of the hide animation. **Deprecated:** since v21.0.0. Use `motionOptions` instead. |
| `motionOptions` | `MotionOptions \| undefined` | _not documented_ | The motion options. |
| `breakpoints` | `{ [key: string]: any } \| undefined` | _not documented_ | Object literal to define styles per screen size. |

| Output | Type | Description |
| --- | --- | --- |
| `onClose` | `EventEmitter<ToastCloseEvent>` | Callback to invoke when a message is closed. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #message>` | `template` | Custom message template. |
| `<ng-template #headless>` | `headlessTemplate` | Custom headless template. |
