Skip to content

Empty State Component for React

An animated React empty state component that shows one clear next step when a page, list or search has nothing in it yet.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/empty-state.json

No projects yet

Projects keep your screens and tokens together.

First run

Full variant on a dashed outline: icon, title, description, a primary and a secondary action.

Create your first project

Projects keep your screens, tokens and assets together. Start from scratch or import a design file.

Files to copy

5 folders · 6 files · 4 packages
From theme/src/
  • components/empty-state/
  • hooks/{use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, heading.ts, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/empty-state.jsonRegistry item: empty-state. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/button/
  • components/spinner/
  • hooks/{use-latest.ts, use-magnetic.ts}
  • motion/gate.ts
  • lib/{form.ts, state-light.tsx}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

No results

Neutral tone on a glass card. announce reads it out when a search comes back empty, through one status region that stays mounted (a region that mounts with its text is often skipped by screen readers).

No results for “glassmorphism tokens”

Check the spelling or try fewer words.

Compact and error

Compact: one row for tables, inboxes and sidebars (it wraps on phones). Tones color the icon only; the words carry the meaning.

Inbox zero

New messages from your team show up here.

Couldn't load invoices

The server took too long to answer.

Props

PropTypeDefaultDescription
iconReactNodeNoneAn icon (24px, currentColor) shown in the glass orb (full) or tile (compact).
illustrationReactNodeNoneYour own artwork, shown instead of the orb (an SVG or image, sized by you).
title (required)ReactNodeNoneThe heading: say what is missing ("No messages yet").
descriptionReactNodeNoneOne sentence on why it is empty and what to do.
actionReactNodeNoneThe main next step, usually a primary Button.
secondaryActionReactNodeNoneA lower-emphasis alternative, usually a ghost or glass Button / link.
variant"full" | "compact""full"full (default): centred, for pages and panels. compact: one row, for tables and small cards.
surface"glass" | "none" | "dashed""none"none (default), glass (its own card) or dashed (a drop-zone-like outline).
tone"neutral" | "accent" | "success" | "warning" | "danger""accent"Colour of the icon and its tint (default "accent"). Words carry the meaning; colour only supports it.
headingLevelfalse | HeadingLevelOption3Heading level of the title (1 to 6, default 3), to fit the page outline. "none" renders a paragraph with no heading role. false is the deprecated spelling of "none" (still accepted, removed in 1.0).
animatedbooleantrueEntrance animation (off under reduced motion either way).
announcestring | booleanNoneAnnounce the empty state to screen readers when it appears (e.g. a search with no results): true speaks the title and description (when they are text), a string speaks that. Uses one persistent polite region, so it is read reliably.

Keyboard

KeysAction
TabNot focusable: the block is not focusable. The buttons in action and secondaryAction are normal tab stops.

Accessibility

  • Plain markup with a heading; the icon is decorative. Pass announce to tell screen readers when the state appears after a search or filter.
  • Always offer a way forward (clear the filter, create the first item); do not leave an empty state without an action when one exists.

When to use the empty state

  • Use it as an empty state UI for a first-run dashboard or project list, with an icon, a title, one sentence of explanation, a primary Button to create the first item and a secondary action such as Import.
  • Use it for search and filter results that come back empty, with the neutral tone, a hint to check spelling and announce so screen readers hear that nothing matched.
  • Use variant="compact" inside tables, inboxes and sidebars, where a single row such as Inbox zero or Couldn't load invoices fits and the danger tone colors the icon and its tint.
  • Skip it for content that is still loading; Skeleton holds the layout while data arrives, and Alert is better for a persistent warning or error message above existing content.
  • Pair it with Button for the next step, Input in children for a search field, and Skeleton to show the loading state before the empty one.

Frequently asked questions

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .