Components

Empty

Use the Empty component to display an empty state.

PreviewSource
No Projects Yet
You haven't created any projects yet. Get started by creating your first project.
Learn More
Example requirements

Also uses: Button.

bun add --exact lucide-preact@1.55.0

Installation

Complete the project setup first. The init command configures TypeScript, Vite, Tailwind CSS v4, and Preact compatibility.

CLI

Run init once using the installation guide, then add this component. The CLI copies the required source files and installs their exact dependencies with Bun.

bunx --bun github:LiasCode/shadcn-preact#main add empty button

Add --dry-run to review the changes. Existing modified files are protected; use --overwrite only when you want to replace them.

Manual installation / degit (optional)

1. Install dependencies

bun add --exact class-variance-authority@0.7.1 cn@0.4.0 preact@11.0.1 tw-animate-css@1.4.0

The usage example also needs Button. Follow their installation guides as well.

2. Copy the component with degit

Run this from your project root. It selects empty.tsx, its local dependencies, and both licenses directly from the repository, then copies them into src/components/ui.

bunx degit@3.10.0 https://github.com/LiasCode/shadcn-preact#main ./.cache/shadcn-preact/empty --files LICENSE.md,registry/ui/empty.tsx,registry/ui/lib/utils.ts,registry/ui/primitives/LICENSE,registry/ui/primitives/internals/types.ts --force
mkdir -p ./src/components/ui
cp -R ./.cache/shadcn-preact/empty/registry/ui/. ./src/components/ui/
cp ./.cache/shadcn-preact/empty/LICENSE.md ./src/components/ui/LICENSE.md

The temporary copy lives in .cache/shadcn-preact/empty. Existing components stay in place; shared source files are updated from main.

Selected source files (4)

Usage

import { Button } from "./components/ui/button";
import {
  Empty,
  EmptyContent,
  EmptyDescription,
  EmptyHeader,
  EmptyMedia,
  EmptyTitle,
} from "./components/ui/empty"
<Empty>
  <EmptyHeader>
    <EmptyMedia variant="icon">
      <Icon />
    </EmptyMedia>
    <EmptyTitle>No data</EmptyTitle>
    <EmptyDescription>No data found</EmptyDescription>
  </EmptyHeader>
  <EmptyContent>
    <Button>Add data</Button>
  </EmptyContent>
</Empty>

Examples

Outline

Use the border utility class to create an outline empty state.

OutlineSource
Cloud Storage Empty
Upload files to your cloud storage to access them anywhere.
Example requirements

Also uses: Button.

bun add --exact lucide-preact@1.55.0

Background

Use the bg- and bg-gradient- utilities to add a background to the empty state.

BackgroundSource
No Notifications
You're all caught up. New notifications will appear here.
Example requirements

Also uses: Button.

bun add --exact lucide-preact@1.55.0

Avatar

Use the EmptyMedia component to display an avatar in the empty state.

AvatarSource
LR
User Offline
This user is currently offline. You can leave a message to notify them or try again later.
Example requirements

Also uses: Avatar, Button.

Avatar Group

Use the EmptyMedia component to display an avatar group in the empty state.

Avatar GroupSource
CNLRER
No Team Members
Invite your team to collaborate on this project.
Example requirements

Also uses: Avatar, Button.

bun add --exact lucide-preact@1.55.0

InputGroup

You can add an InputGroup component to the EmptyContent component.

InputGroupSource
404 - Not Found
The page you're looking for doesn't exist. Try searching for what you need below.
/
Need help? Contact support
Example requirements

Also uses: Input Group, Kbd.

bun add --exact lucide-preact@1.55.0

Card

No projects yet
You haven't created any projects yet. Get started by creating your first project.
Example requirements

Also uses: Button.

bun add --exact lucide-preact@1.55.0

Reference

See the official Empty documentation for composition patterns and API details. This page uses the Preact port and examples from the pinned upstream revision.

Component source