Messages
EmptyState
What to show where there is nothing yet, or where something just finished: an icon, a line saying what happened, and what to do next.
WAI-ARIA tested
Import
main.ts
import { EmptyState } from '@vitral/vue';Basic
No invoices yet
Invoices you send appear here, with whether each was paid.
Results
A `severity` turns an absence into an outcome: the icon and its colour follow it.
Payment received
A receipt is on its way to your email.
The upload failed
The file is larger than 20 MB.
Small, and aligned to the start
For a panel or a table with no rows: `size="small"` and `align="start"`.
No results for “invoces”
Check the spelling, or search every folder.
API
Read from packages/vue/src/components/EmptyState/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| title | string | — |
| description | string | — |
| icon | IconProp | false | Defaults to the severity's icon, or an empty tray. `false` draws none. |
| severity | 'success' | 'info' | 'warn' | 'danger' | Turns the absence into a result: `success` after something worked, `danger` when it did not. The icon takes the severity's colour. |
| size | Size | — |
| align | 'center' | 'start' | Defaults to `'center'`. |
| headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | Make the title a heading of this level, so it takes its place in the page's outline. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | Replaces the description. |
| icon | — | — |
| title | — | — |
| actions | — | Buttons below the text: what to do about it. |