Internal ID software / Status and waiting
EmptyState
The empty case of a list or a search: what is missing, why, and one way out.
Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/empty-state.tsx. From the old system: EmptyState in @id-identity-as/ui/data.
Example
import { EmptyState } from '@/components/software/empty-state';
<EmptyState
title="Ingen ordrer endnu"
text="Ordrer fra dine kolleger vises her, når de er godkendt."
action={<a className={buttonClasses({ variant: 'outline' })} href="/katalog">Gå til kataloget</a>}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
title (required) | string | What is missing, as a heading. | |
level | 2 | 3 | 4 | 3 | The heading level of the title. |
text | string | Why it is empty, and what makes it fill. | |
action | ReactNode | The one way out, such as a link styled with buttonClasses. |
Do
- Tell an empty list from an empty search: "Ingen ordrer endnu" is not "Ingen ordrer i perioden".
- Give one way out.
Do not
- Do not leave a table with only its header. Show the empty state instead.
- Do not decorate it with an illustration or an icon the set does not have.
Accessibility
- The title is a heading, so it lands in the outline of the page.
Tokens it uses
- color.border.default
- color.software.muted
- radius.sm
- type.heading.md
- type.body.md
- space.inline.3
- space.section.1