Skip to content

Empty state

Pro

Fills a region with nothing to show: no posts yet, no results, coming soon, or couldn't load with a retry. Not an M3 component (@windmorph/react-pro).

import { EmptyState } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Keyboard

None. It has no keys of its own; its actions are Buttons with theirs.

Screen reader

Role
A plain div (or a Card for the card variants); status with announce.
Accessible name
None of its own: the title and description are read as its text. With headingLevel (2 to 6) the title is a heading of that level.
States announced
None.
  • The icon is decorative and hidden from assistive tech (aria-hidden).
  • With announce, it is a status live region that goes into the page a moment (100ms) before its title and description, so they are read politely when it replaces results after a search or filter. One in the server's HTML shows at once.

Focus

Only its actions take focus, in the Tab order after the description. It moves no focus when it appears.

Touch target

It has nothing to press itself. Its actions keep their own Button targets: 48 × 48px at the least, through an invisible touch target on the small sizes.

Motion

It fades in on the default effects spring as it appears, under reduced motion too: a fade is not movement.

What you need to do

  • Write a title that says what is missing ("No results"), and a description that says why or what to do; the icon and its colour are not read.
  • Use headingLevel for a heading when the empty state is a section's only content, so the page outline stays whole.
  • Set announce when the empty state replaces content after a search or filter, so screen-reader users hear the result.
  • In forced-colours mode the icon keeps the text colour.