# Empty state

> What to show when there is nothing to show, with the reason and the next step.

Category: Feedback · Atomic level: molecule
Page: https://ui.dtheo.dev/docs/components/empty

## Install

```bash
npx dtheo@latest add empty
# or, with the shadcn CLI
npx shadcn@latest add https://ui.dtheo.dev/r/empty.json
```

Dependencies: clsx, tailwind-merge. Registry dependencies: utils.

## Exports

`Empty`, `EmptyMedia`, `EmptyTitle`, `EmptyDescription`, `EmptyActions`

## Use it for

- No data yet
- No results for a filter
- No permission

## Reach for something else

- Loading: use Skeleton or Spinner; an empty state means the load finished
- Errors: use Alert with Retry

## Examples

### empty

```tsx
import { FilterXIcon, PlayIcon, SearchXIcon, ServerIcon, UploadIcon } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Empty, EmptyActions, EmptyDescription, EmptyMedia, EmptyTitle } from '@/components/ui/empty';

export default function EmptyExample() {
  return (
    <div className="grid w-full gap-3 sm:grid-cols-2">
      {/* No data yet: say why and offer the first action. */}
      <Empty className="justify-start border border-border bg-card">
        <EmptyMedia>
          <ServerIcon aria-hidden="true" />
        </EmptyMedia>
        <EmptyTitle>No runs on Bench 3 yet</EmptyTitle>
        <EmptyDescription>
          Run a step test to record torque, phase current and winding temperature.
        </EmptyDescription>
        <EmptyActions>
          <Button variant="primary">
            <PlayIcon aria-hidden="true" />
            Run step test
          </Button>
          <Button variant="ghost">
            <UploadIcon aria-hidden="true" />
            Import CSV
          </Button>
        </EmptyActions>
      </Empty>
      {/* No results: name the filter that hid everything and offer to clear it. */}
      <Empty className="justify-start border border-border bg-card">
        <EmptyMedia>
          <SearchXIcon aria-hidden="true" />
        </EmptyMedia>
        <EmptyTitle>No runs match these filters</EmptyTitle>
        <EmptyDescription>No failed runs on firmware 4.18.2 in the last 7 days.</EmptyDescription>
        <EmptyActions>
          <Button>
            <FilterXIcon aria-hidden="true" />
            Clear filters
          </Button>
        </EmptyActions>
      </Empty>
    </div>
  );
}
```

## Used in

- Run review (page): https://ui.dtheo.dev/examples/run-review
- Data table pattern (template): https://ui.dtheo.dev/docs/patterns/data-table
- States pattern (template): https://ui.dtheo.dev/docs/patterns/states
