Skip to content

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

Ingen ordrer endnu

Ordrer fra dine kolleger vises her, når de er godkendt.

Gå til kataloget

Ingen ordrer endnu

Ordrer fra dine kolleger vises her, når de er godkendt.

Gå til kataloget
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

PropTypeDefaultWhat it does
title (required)stringWhat is missing, as a heading.
level2 | 3 | 43The heading level of the title.
textstringWhy it is empty, and what makes it fill.
actionReactNodeThe 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