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.jsonNo 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.
import { Button } from "@/components/sheenui/button/button";
import { EmptyState } from "@/components/sheenui/empty-state/empty-state";
// Package build (after the first npm release, or a packed tarball): import { Button, EmptyState } from "@sheenui/theme";
import { Folder as FolderIcon, Plus as PlusIcon } from "lucide-react";
// This example also uses button: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json
export function Example() {
return (
<EmptyState
surface="dashed"
icon={<FolderIcon />}
title="Create your first project"
description="Projects keep your screens, tokens and assets together. Start from scratch or import a design file."
action={<Button leading={<PlusIcon />}>New project</Button>}
secondaryAction={<Button variant="glass">Import a file</Button>}
/>
);
}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.tslib/{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.tslib/{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.
import { useState } from "react";
import { Button } from "@/components/sheenui/button/button";
import { EmptyState } from "@/components/sheenui/empty-state/empty-state";
// Package build (after the first npm release, or a packed tarball): import { Button, EmptyState } from "@sheenui/theme";
import { Search as SearchIcon } from "lucide-react";
// This example also uses button: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json
export function Example() {
const [query, setQuery] = useState("flrbl");
return (
<EmptyState
announce
surface="glass"
tone="neutral"
icon={<SearchIcon />}
title={`No results for “${query}”`}
description="Check the spelling or try fewer words."
action={<Button variant="glass" onClick={() => setQuery("")}>Clear search</Button>}
/>
);
}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.
import { Button } from "@/components/sheenui/button/button";
import { EmptyState } from "@/components/sheenui/empty-state/empty-state";
// Package build (after the first npm release, or a packed tarball): import { Button, EmptyState } from "@sheenui/theme";
import { CloudOff as CloudOffIcon, Inbox as InboxIcon } from "lucide-react";
// This example also uses button: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json
export function Example() {
return (
<>
<EmptyState
variant="compact"
surface="glass"
icon={<InboxIcon />}
title="Inbox zero"
description="New messages from your team show up here."
action={<Button size="sm" variant="glass">Compose</Button>}
/>
<EmptyState
variant="compact"
surface="glass"
tone="danger"
icon={<CloudOffIcon />}
title="Couldn't load invoices"
description="The server took too long to answer."
action={<Button size="sm">Try again</Button>}
/>
</>
);
}Props
Keyboard
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
Related pages
67 components pages in all: browse them on All components.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .