Beta

Search Documentation

Search through documentation pages

Components

Empty

A placeholder component for empty states with support for icons, titles, and actions.

Preview

'use client';

import { Button } from '@/registry/san-francisco/ui/button';
import {
  Empty,
  EmptyContent,
  EmptyDescription,
  EmptyHeader,
  EmptyMedia,
  EmptyTitle,
} from '@/registry/san-francisco/ui/empty';
import { InboxIcon, SearchIcon } from 'lucide-react';

export default function EmptyDemo() {
  return (
    <Empty>
      <EmptyHeader>
        <EmptyMedia>
          <InboxIcon />
        </EmptyMedia>
        <EmptyTitle>No items found</EmptyTitle>
        <EmptyDescription>You don&apos;t have any items yet. Create one to get started.</EmptyDescription>
      </EmptyHeader>
      <EmptyContent>
        <Button>Create Item</Button>
      </EmptyContent>
    </Empty>
  );
}

Installation

bun
bunx shadcn@latest add @sft-ui/empty

Media Variants

The EmptyMedia component supports default and icon variants. The icon variant renders a contained icon with a muted background.

'use client';

import { Button } from '@/registry/san-francisco/ui/button';
import {
  Empty,
  EmptyContent,
  EmptyDescription,
  EmptyHeader,
  EmptyMedia,
  EmptyTitle,
} from '@/registry/san-francisco/ui/empty';
import { InboxIcon, SearchIcon } from 'lucide-react';

export default function EmptyDemoMediaVariants() {
  return (
    <Empty>
      <EmptyHeader>
        <EmptyMedia variant="icon">
          <SearchIcon />
        </EmptyMedia>
        <EmptyTitle>No results</EmptyTitle>
        <EmptyDescription>Try adjusting your search or filters.</EmptyDescription>
      </EmptyHeader>
    </Empty>
  );
}

API Reference

Empty

The root container for the empty state. All standard HTML div attributes are supported.

EmptyHeader

Wraps the icon, title, and description at the top of the empty state.

EmptyMedia

Displays an icon or illustration.

PropTypeDefaultDescription
variant"default" | "icon""default""icon" renders a contained icon with a muted background.
classNamestringAdditional CSS classes to apply.

EmptyTitle

The heading text for the empty state.

EmptyDescription

Supporting text below the title.

EmptyContent

A container for action buttons or other content below the header.