Skip to content

EmptyState: The component is used for states that aren't empty #87142

Open

Description

@jameskoster

What problem does this address?

EmptyState in @wordpress/ui lays out an icon or visual, a title, a description and actions, centred, in place of content. While reviewing #86490, we found that this arrangement fits situations that aren't empty states, which raised the question of whether the name and guidance still describe what the component is for.

Current uses:

  • In Media Editor: Add a placeholder state with download and copy buttons #86490, the media editor uses it when an attachment's file can't be loaded, with buttons to copy and download the URL. The attachment record exists, so nothing is empty; the content is unavailable.
  • The boot error boundary (packages/boot/src/components/error-boundary/index.tsx) uses it for "Something went wrong", with a button to copy the error.
  • The widget dashboard uses it when no widgets have been added, which is an empty state in the strict sense.

See the discussion in #86490 for more context.

Some possible consequences of the mismatch:

  • Discoverability. Someone building an error or "unavailable" screen may not look for a component called EmptyState.
  • Guidance. The docs and the design system MCP describe it as being for empty states, so contributors, agents and reviewers may rule out, or flag, uses like the ones above.
  • Overlap with Notice. It isn't stated when a failure should be shown with a Notice and when with this layout. This came up in Media Editor: Add a placeholder state with download and copy buttons #86490 too.

Constraints

  • The component's behaviour isn't in question. Adding a second component with identical functionality seems undesirable.
  • EmptyState is marked recommended and is published on npm, so any rename would need to keep the current name working, at least for a deprecation period.

Possible directions

These are starting points for discussion, not a recommendation.

  1. Keep the name and broaden the guidance. Document EmptyState as suitable for other states where content is replaced by a message (errors, unavailable content, missing permissions), and add stories for them.
    • Non-breaking, and no churn for consumers.
    • The name still says "empty", so discoverability may not improve much.
  2. Rename, keeping EmptyState as a deprecated alias.
    • A name could describe every use.
    • Churn for consumers, and the new name needs to avoid clashing with existing ones (Placeholder in @wordpress/components, Autocomplete.Empty, and others).
  3. Add a second export for the same component.
    • Each use can pick the name that fits, without a deprecation.
    • Two names for one component may cause its own confusion.
  4. Leave things as they are. Using EmptyState for nearby cases may be fine, and these uses are rare enough not to need a change.

Separately from the name, it may be worth documenting when to use this layout rather than a Notice.

Questions

  • Is this a problem worth solving, or is the current name good enough?
  • Are there other directions we haven't considered?
  • Should we document how this relates to Notice, and if so, what's the distinction?

Feedback welcome!

Activity

  1. added
    Design SystemIssues related to the system of combining components according to best practices.
    on Nov 20, 2026
  2. aduth commented on Nov 20, 2026

    @aduth
    Member

    There might be even more examples of these kinds of arrangements of "visual" + "blurb of text" + "two button options" that could sort-of align to this same pattern of what we do in EmptyState today, that also aren't "empty state"s.

    For example, here's another one I saw in a design lately (cc @mattmiklic ):

    image

    I don't know to what extent we really need to support all these cases through a proper component abstraction. At the end of the day, it's really just a series of vertical and horizontal Stacks with some gap, it's not that hard for someone to build on their own, and we could provide some guidance around it. In that way a "5th option" could even be to remove components altogether and document this as a pattern instead. Though I'm not personally a fan of this option, since I think there's some value in having an off-the-shelf solution for a common use-case that pre-prescribes specific configuration that gives certainty that the pattern is implemented consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design SystemIssues related to the system of combining components according to best practices.[Package] UI/packages/ui

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions