Xzero UI
Pro library

Empty state

A useful next step when there is nothing to show yet.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/empty-state
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/empty-state

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Search } from "lucide-react";
import { Button } from "@/components/xzero/button/button";
import { EmptyState } from "@/components/xzero/empty-state/empty-state";

export function NoResults({ onClear }: { onClear: () => void }) {
  return (
    <EmptyState
      icon={<Search size={24} />}
      title="No matches"
      description="Try a shorter search or clear the filters."
      action={<Button variant="secondary" onClick={onClear}>Clear filters</Button>}
    />
  );
}

API reference

EmptyState

A centered icon, title, description, and optional action for empty views.

PropTypeDefaultDescription
title (required)string–Headline. A new title rises in while the old one leaves.
description (required)string–One or two sentences on why it is empty and what to do.
actionReactNode–Call to action, usually a button.
iconReactNode<Folder />Leading icon. A different icon component crossfades in.
classNamestring–Class for the root section.
labelstring–Accessible name for the section region.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in cards

Guidance for AI tools

Empty state: A useful next step when there is nothing to show yet. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components