EmptyState

A centred placeholder for the moments when there is nothing to show: an empty list, a search with no results, a first-run screen. It explains why and offers the next step.

StableSource

No invoices yet

Invoices you create or receive will show up here.

Import

tsx
import { EmptyState } from "@merid/react";

Examples

Plain

variant="plain" drops the tray background — use it inside a card or table frame that already has a surface. titleLevel sets the heading level to fit the page outline.

No results for “quarterly”

Try a shorter search or check the spelling.

Title only

Only title is required.

Nothing to review

API reference

Renders a div; the ref and other div attributes are forwarded (the native title attribute is replaced by the title prop).

PropTypeDefaultDescription
titleRequiredReactNode–Short headline, e.g. "No invoices yet".
descriptionReactNode–One or two sentences explaining what to do next.
iconReactNode–Icon shown in a soft accent tile. Decorative.
actionReactNode–Primary action(s), usually a Button.
titleLevel1 | 2 | 3 | 4 | 5 | 63Heading level for title.
variant"tray" | "plain""tray"Surface: tray is a recessed panel, plain has no background.

Styling

HookValues
.mrd-empty-stateRoot; data-variant = tray · plain
.mrd-empty-state__iconAccent-soft icon tile
.mrd-empty-state__titleHeading
.mrd-empty-state__descriptionBody text
.mrd-empty-state__actionAction row

EmptyState has no component variables.

Accessibility

  • The title is a real heading (h3 by default); set titleLevel so it fits the surrounding outline.
  • The icon is aria-hidden; the title must carry the meaning on its own.
  • When the empty state replaces results after a search, announce the change — for example render the result count in a polite live region.

Guidelines

Do

Say what is missing and how to fill it: “No invoices yet” plus a “New invoice” button.

Avoid

Show a bare “No data” or a large illustration with no way forward.

  • Table — the most common place an empty state appears.
  • Skeleton — while data is still loading, before you know it is empty.
  • Button — the action.