Empty State

A friendly empty-state placeholder for empty lists, no-search-results and error screens. It shows a floating icon tile (five built-in presets or a custom icon), a title, a description and optional actions, with a staggered entrance animation.

Empty State
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @reactframe/empty-state

Requires @reactframe in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { EmptyState } from "@/components/empty-state"export function Example() {  return <EmptyState preset="search" action={<button type="button">Clear filters</button>} />}
  • Showing an empty inbox, folder, or cart where no content exists yet
  • Displaying a no-results state after a search or filter returns nothing
  • Presenting a recoverable error with a retry or help action
  • Building a polished placeholder that offers a primary and secondary call to action

Examples

Empty inbox with default copy

Uses the inbox preset with its built-in title and description.

empty-inbox-with-default-copy.tsx
import { EmptyState } from "@/components/empty-state"export function InboxEmpty() {  return <EmptyState preset="inbox" />}

Search with primary and secondary actions

Card variant on a light background with two action buttons.

search-with-primary-and-secondary-actions.tsx
import { EmptyState } from "@/components/empty-state"export function SearchEmpty() {  return (    <EmptyState      preset="search"      variant="card"      theme="light"      action={<button type="button" className="rounded-md bg-black px-3 py-1.5 text-sm text-white">Clear filters</button>}      secondaryAction={<button type="button" className="rounded-md border px-3 py-1.5 text-sm">Browse all</button>}    />  )}

Error state with custom copy and no float

Error preset with overridden title and description, dashed container, large size and static icon.

error-state-with-custom-copy-and-no-float.tsx
import { EmptyState } from "@/components/empty-state"export function ErrorEmpty() {  return (    <EmptyState      preset="error"      size="lg"      variant="dashed"      float={false}      title="Couldn't load your reports"      description="The server did not respond. Please retry in a moment."      action={<button type="button" className="rounded-md bg-white px-3 py-1.5 text-sm text-black">Retry</button>}    />  )}

API reference

PropTypeDefaultDescription
presetEmptyStatePreset ("inbox" | "search" | "folder" | "cart" | "error")"inbox"Selects the built-in icon and default title/description copy.
iconReact.ReactNode—Custom icon that replaces the preset icon inside the tile.
titleReact.ReactNode—Heading text. When undefined, the preset default title is used; passing null or an empty value hides the heading.
descriptionReact.ReactNode—Body text. When undefined, the preset default description is used; passing null or an empty value hides it.
actionReact.ReactNode—Primary action element rendered in the actions row.
secondaryActionReact.ReactNode—Secondary action element rendered next to the primary action.
variantEmptyStateVariant ("plain" | "card" | "dashed")"plain"Container style: no container, solid card with border, or dashed border.
sizeEmptyStateSize ("sm" | "md" | "lg")"md"Scales the icon tile, icon, typography, gap, padding and max width.
theme"dark" | "light""dark"Color palette for text, borders, tile and card background.
floatbooleantrueEnables the looping vertical bob animation on the icon tile (disabled when reduced motion is preferred).
classNamestring—Additional classes merged into the root element via tailwind-merge.

Accessibility

  • The root element has role="status", so screen readers announce its content politely when it appears or changes.
  • Preset icons are SVGs marked aria-hidden, so they are not read out; the title and description carry the meaning.
  • Pass a meaningful title; the heading is rendered as an h3, so place it under an appropriate heading level in the page.
  • The floating animation respects prefers-reduced-motion via useReducedMotion and stops bobbing; the entrance fade also remains subtle.
  • Action elements are rendered as provided, so supply focusable buttons or links with visible labels.
  • Ensure the color palette used via theme meets contrast requirements against the surrounding background, especially the muted description color.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Empty State" component (reactframe/empty-state) from its shadcn registry.1. Install it with: npx shadcn@latest add @reactframe/empty-state2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: preset, icon, title, description, action, secondaryAction, variant, size, theme, float, className.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { EmptyState } from "@/components/empty-state"export function Example() {  return <EmptyState preset="search" action={<button type="button">Clear filters</button>} />}```

Files & dependencies

  • registry/new-york/empty-state/empty-state.tsx
dependenciesmotionclsxtailwind-merge

Looks similar, elsewhere