Search

Find a component, token or page

Base · Feedback

Empty

A placeholder for an area that has no content yet, explaining why and what to do next.

HTML / JSPlannedReactStableReact NativeDraftSwift (SwiftUI)PlannedGodotPlannedVueDraftSvelteDraftSolidDraft
Reviewed
No shipments yet
Shipments you create or import will appear here.

Props

tsx
import { Button } from "@/components/ui/button"
import {
  Empty,
  EmptyContent,
  EmptyDescription,
  EmptyHeader,
  EmptyMedia,
  EmptyTitle,
} from "@/components/ui/empty"
import { PackageIcon, PlusIcon } from "lucide-react"

<Empty className="border">
  <EmptyHeader>
    <EmptyMedia>
      <PackageIcon aria-hidden="true" />
    </EmptyMedia>
    <EmptyTitle>No shipments yet</EmptyTitle>
    <EmptyDescription>Shipments you create or import will appear here.</EmptyDescription>
  </EmptyHeader>
  <EmptyContent>
    <Button>
      <PlusIcon data-icon="inline-start" />
      Create shipment
    </Button>
  </EmptyContent>
</Empty>

Overview

An empty state fills a list, table or page that has nothing to show. It says what belongs there, why it is empty, and gives the user one clear way forward.

When to use

  • When a list or table has no items yet: explain what will appear and offer the action that creates the first one.
  • When a search or filter returns nothing: say so and offer to clear the filters.
  • When a feature has not been set up, or the user lacks access to its content.

When not to use

  • While data is still loading: use Skeletons or a Spinner.
  • When loading failed: use an Alert with a way to retry. An error is not an empty state.
  • For a single empty cell or field: show a dash or short muted text instead.

Anatomy

  1. Container

    Centers its content and fills the available space. Add a border class to get a dashed outline.

  2. Media (optional)

    An icon or illustration. The icon variant places the icon in a small muted square.

  3. Title

    States what is missing, such as “No shipments yet”.

  4. Description

    One or two sentences on why it is empty and what to do.

  5. Content (optional)

    The action: usually one Button, sometimes with a secondary link.

Props

The contract every language implements. Names follow each language’s conventions (camelCase in React, snake_case in Rust).

PropTypeDefaultDescription
variant"default" | "icon"defaultSet on EmptyMedia. `icon` frames a small icon in a muted square; `default` shows the media as is, for illustrations or avatars.
titlestringNo shipments yetPassed as children of EmptyTitle.
descriptionstringShipments you create or import will appear here.Passed as children of EmptyDescription.
actionLabelstringCreate shipmentLabel of the button in EmptyContent.

States

First use
Nothing has been created. Lead with the creating action.
No results
A search or filter matched nothing. Offer to clear it rather than create.

Accessibility

KeysAction
TabMoves focus to the action inside the empty state.
  • The title is a div, not a heading. Render a heading element inside it when the empty state is the main content of the page.
  • Icons and illustrations are decorative; hide them with aria-hidden.
  • When results become empty after a filter change, announce it with a polite live region.

Design tokens

Change any of these in Foundations and this component follows, in every language.

Platform notes

HTML / JS
Planned
Not built in HTML / JS yet.
React
Stable
Matches the contract with no platform differences.
React Native
Draft
A centred column that grows to fill a FlatList's ListEmptyComponent. The dashed border is zero width until you add borderWidth.
Swift (SwiftUI)
Planned
Not built in Swift yet.
Godot
Planned
Not built in Godot yet.
Vue
Draft
Usage snippet only; same props and behavior as the React component.
Svelte
Draft
Usage snippet only; same props and behavior as the React component.
Solid
Draft
Usage snippet only; same props and behavior as the React component.

Related