Empty state
vig-empty-state [vigEmptyStateMedia] [vigEmptyStateActions]
import { EmptyState, EmptyStateMedia, EmptyStateActions } from '@vigdx/ui/empty-state';Basic
heading names the section (it replaces the deprecated title , which also set the native tooltip); description explains why the view is empty and icon names a registered icon shown above.
No messages
Messages from your team and customers will appear here.
Actions
vigEmptyStateActions to add a centered action row. class="contents" lets its buttons join the row's own wrapping flex layout.
No invoices yet
Create your first invoice or import existing ones from a CSV file.
Sizes
size scales spacing, icon and type: sm for tables, popovers and panels, md (default) for cards and sections, lg for a whole page.
Small
For table bodies, popovers and side panels.
Medium
The default, for cards and page sections.
Large
For a whole empty page.
Custom media
vigEmptyStateMedia element, such as an illustration, replaces the icon. It is tinted with the muted text color, so currentColor strokes follow the theme.
Your board is empty
Boards collect the tasks of one project. Add a column to get started.
No results
headingLevel fits the heading into the surrounding outline, here under the card's heading.
Teams
0 teams found
No matching teams
Check the spelling or clear the filter.
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="empty-state"][data-part="root"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="empty-state"]
| Part | Element | data-state |
|---|---|---|
root | <section> . | — |
media | [vigEmptyStateMedia] slot. | — |
icon | — | |
heading | h2 – h6 heading. | — |
description | — | |
actions | [vigEmptyStateActions] slot. | — |
Accessibility
- Renders a
<section>labelled by its heading, a realh2–h6heading atheadingLevel(3 by default). Choose the level that fits the page outline. - The icon is decorative. Hide custom media from assistive technology with
aria-hidden="true", or give a meaningful image analt. - Actions are the consumer's own buttons and links; label them with what they do, e.g. “New invoice” rather than “Get started”.
- When an empty state replaces results after user input, as with a filter, announce the change, e.g. with a result count in a
role="status"element.
API
EmptyState
vig-empty-statePlaceholder for views with nothing to show yet: a large icon (or a
projected [vigEmptyStateMedia] illustration), a heading, an optional
description and a [vigEmptyStateActions] row. Rendered as a <section>
named by its heading.
<vig-empty-state icon="inbox" heading="No payments yet" description="…">
<div vigEmptyStateActions><vig-button label="Add payment" /></div>
</vig-empty-state>| Name | Type | Default | Description |
|---|---|---|---|
description | string | undefined | undefined | — |
heading | string | undefined | undefined | Heading text; also names the section. Set it (or the deprecated |
headingLevel | EmptyStateHeadingLevel | 3 | Heading level ( |
icon | string | undefined | undefined | Registered |
size | EmptyStateSize | 'md' | — |
title | string | undefined | undefined | Deprecated: Use `heading`; `title` is also the native tooltip attribute. Still honored when `heading` is unset, and never shown as a tooltip. — |
Templates and directives
| Selector | Export | Description |
|---|---|---|
[vigEmptyStateMedia] | EmptyStateMedia | Marks projected content (illustration, image) as the empty state's media. |
[vigEmptyStateActions] | EmptyStateActions | Marks projected content as the empty state's action row. |