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.

Props

By name or description, across the 14 props below

EmptyState 14 props

  • icontype ReactNodeRequired

    The icon, drawn at the size's icon size in the colour's content role. Decorative.

  • titletype ReactNodeRequired

    What's missing, in a few words: "No posts yet", "No results".

  • descriptiontype ReactNode

    One line about why, or what will appear here.

  • actionstype ReactNode

    Up to two Buttons: at most one filled or tonal, then a text one.

  • varianttype "plain" | "filled" | "elevated" | "outlined"default "plain"

    plain (no container) or a card variant.

  • sizetype "sm" | "md" | "lg"default "md"

    sm in a list or small card, md in a section, lg for a page area.

  • colortype "primary" | "secondary" | "tertiary" | "neutral" | "error" | "success" | "warning"default "secondary"

    The icon container's colour roles: error for "couldn't load", success for "all done", warning for something to look at.

  • shapetype ShapedIconShapedefault "circle"

    The icon container's shape: circle or a shape outline (shape={cookie9SidedShape}).

  • headingLeveltype 2 | 3 | 4 | 5 | 6

    Makes the title a heading of this level, when the empty state is a section's only content. Left out, the title is a paragraph.

  • announcetype booleandefault false

    Announces the title and description to screen readers (role="status"), for an empty state that replaces content after a search or filter. The region goes into the page first and its content shows a moment later, so it's announced as it appears.

  • reftype Ref<HTMLDivElement>

    The root element.

Also accepts the root element's HTML attributes (id, data-*, event handlers).

Spec status

Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.

  • Variant: plain, filled, elevated, outlined

    Built

    Variant · Variants, No posts

  • Size: sm, md, lg

    Built

    Configuration · Variants, Search, Retry

  • Colour and an M3 Expressive shape (a shape constant)

    Built

    Configuration · Search, Retry, Done

  • Nothing here yet

    Built

    Use case · No posts

  • No results, announced

    Built

    Use case · Search

  • Couldn’t load, with a retry

    Built

    Use case · Retry

  • All caught up, at the end of a feed

    Built

    Use case · Done

M3 Expressive specs

Shape
rounded-full
Variants
plain, filled, elevated, outlined

Variants, sizes and colours

  • variant: plain (the default) sits on whatever surface it's in; filled, elevated and outlined wrap it in the matching Card, to sit among cards.
  • size: sm in a list or small card, md in a section, lg for a page area. Each uses its own type roles, icon size and spacing.
  • color colours the icon container with a container role: secondary (the default), primary, tertiary, neutral, success for "all done", warning, or error for "couldn't load".
  • shape is a circle or a shape outline (shape={cookie9SidedShape}, any of the 35 constants from @windmorph/react/primitives, or your own MaterialShapePath).
  • Give at most one filled or tonal action, and a text action second, so the empty state never competes with the page's main action.

Theming

  • Only colour roles: the colour's container and content roles for the icon, on-surface for the title and on-surface-variant for the description, so it follows every theme, mode and contrast level.
  • Override the container colour with className, and any part with classNames (root, media, icon, title, description, actions). A plain root carries data-tokens="wm-empty-state"; it has no values of its own to override beyond the roles above.
  • It fades in on the default effects spring, under reduced motion too. With announce, its live region goes into the page a moment before its content, so screen readers read it; one in the server's HTML shows at once.