Messages
Toast
Notifications sent from anywhere with useToast, stacked at a chosen position, that pause their timer while hovered or focused.
WAI-ARIA tested
Import
main.ts
import { Toast } from '@vitral/vue';Severities
Four seconds each; hover one to keep it.
Sticky and grouped
Without a `life` a toast waits to be closed. A `group` sends it to another `<Toast>`, here one at the bottom.
API
Read from packages/vue/src/components/Toast/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| position | ToastPosition | Defaults to `'top-right'`. |
| group | string | Shows only the messages sent with the same `group`. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| close | event: ToastEvent | Closed by its close button. |
| life-end | event: ToastEvent | Closed because its `life` ran out. |
Slots
| Name | Slot props | Description |
|---|---|---|
| message | (props: { message: ToastMessage }) | Replaces the icon and text of each message; the close button stays. |
| container | (props: { message: ToastMessage; closeCallback: () => void }) | Replaces the whole card's inside, close button included. |
| closeicon | — | — |