Messages
Message
An inline message with a title, an action and a close button, in every severity.
WAI-ARIA tested
Import
main.ts
import { Message } from '@vitral/vue';InfoBar
Title and message share a line while they fit.
Action and close
The action slot holds a button or link; `closable` adds a close button that emits `close`.
Variants
`outlined` and `simple`; every severity works with each.
API
Read from packages/vue/src/components/Message/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| severity | Severity | Defaults to `'info'`. `danger` and `warn` are announced at once, as alerts; the rest politely. |
| title | string | The InfoBar's title, in bold before the message. |
| icon | IconProp | Replaces the severity's icon. |
| hideIcon | boolean | Hide the icon. |
| closable | boolean | Show a close button; closing hides the message and emits `close`. |
| variant | MessageVariant | `'subtle'` (a tinted band, the default), `'outlined'` or `'simple'` (coloured text only). |
| life | number | Milliseconds before it hides by itself; the count pauses while it is hovered or focused. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| close | event: Event | — |
| life-end | — | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |
| action | — | The InfoBar's action area: a button or a link beside the message. |
| icon | — | — |
| closeicon | — | — |