Feedback

Empty State

Friendly placeholder for empty lists or zero-results states.

Preview
01 Installation

Install

Pull Empty State from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { EmptyState } from "@brika/clay";
tsxGranular1 line
import { EmptyState } from "@brika/clay/components/empty-state";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxEmpty State.tsx27 lines
import { Button } from '@brika/clay/components/button';
import {
  EmptyState,
  EmptyStateActions,
  EmptyStateDescription,
  EmptyStateIcon,
  EmptyStateTitle,
} from '@brika/clay/components/empty-state';
import { Inbox } from 'lucide-react';

/** Inbox-zero placeholder, icon, title, description, and optional action. */
export default function EmptyStateDefaultDemo() {
  return (
    <EmptyState className="w-full max-w-md">
      <EmptyStateIcon>
        <Inbox />
      </EmptyStateIcon>
      <EmptyStateTitle>No messages yet</EmptyStateTitle>
      <EmptyStateDescription>
        You are all caught up. New messages will appear here.
      </EmptyStateDescription>
      <EmptyStateActions>
        <Button variant="outline">Refresh</Button>
      </EmptyStateActions>
    </EmptyState>
  );
}
03 Examples

Empty State, every way

Simple

Minimal empty state, title and description only, no icon or actions.

With Action

Search-results placeholder, combine with a clear-search action to guide the user.

04 Accessibility

Accessibility

  • Icon inside EmptyStateIcon is aria-hidden, title and description carry all meaning.
  • Action buttons should have descriptive labels matching the specific task ("Clear search", not "Clear").
  • Empty states announced as a live region can help AT users know when a list becomes empty dynamically.
05 Tokens 4 theme-overridable

Theme tokens

Every CSS variable Empty State reads, with its default and the dotted path you'd write in a ThemeConfig JSON to override it. Set any of these in your theme to retune Empty State without touching component code.

Empty State tokens

4 tokens
ColorFill, border, and text colors.3
  • --empty-state-icon-bgcolorcolor-mix(in oklch, var(--muted) 50%, transparent)
    components.emptyState.iconBg

    Background fill of the rounded icon pill above the title.

  • --empty-state-icon-foregroundcolorvar(--muted-foreground)
    components.emptyState.iconForeground

    Color of the glyph rendered inside the icon pill.

  • --empty-state-description-foregroundcolorvar(--muted-foreground)
    components.emptyState.descriptionForeground

    Text color of the supporting description copy below the title.

ElevationDrop shadow and depth.1
  • --empty-state-backdrop-blurblur0px
    components.emptyState.backdropBlur

    Backdrop blur applied to the empty-state surface. Set non-zero for a frosted-glass treatment.

Override in a theme

Authoring a theme is plain JSON. Drop overrides under components.emptyState, the names are camelCase versions of the variable suffix.

jsonmy-theme.json12 lines
{
  "id": "my-theme",
  "name": "My Theme",
  "description": "...",
  "accentSwatches": ["#000"],

  "components": {
    "emptyState": {
      "iconBg": "color-mix(in oklch, var(--muted) 50%, transparent)"
    }
  }
}

Then apply with applyTheme(myTheme) (see the theming guide), scope it to a subtree with themeToCssVars(myTheme, mode), or consume any token directly in your own JSX with the matching Tailwind utility (e.g. bg-empty-state-…) — see the chips on each token row.

06 API reference

API reference

Props specific to Empty State. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

<EmptyState />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<EmptyStateActions />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<EmptyStateDescription />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<EmptyStateIcon />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<EmptyStateTitle />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.