EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
EmptyState·component·@astryxdesign/core

Empty State

EmptyState shows a placeholder when a content area has no data. Use it for empty lists, zero search results, first-time setups, or cleared inboxes. Always include a title and a next step so the user is not stuck.

Open in Playground @astryxdesign/core/EmptyState

Showcases and examples

4 documented examples

Empty State

A no-results empty state with an icon, descriptive message, and a call-to-action button.

Preview loads on approachPreview loads on approach
Exact source · empty-state-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {EmptyState} from '@astryxdesign/core/EmptyState';
import {Button} from '@astryxdesign/core/Button';
import {Icon} from '@astryxdesign/core/Icon';
import {MagnifyingGlassIcon} from '@heroicons/react/24/outline';

export default function EmptyStateShowcase() {
  return (
    <EmptyState
      icon={<Icon icon={MagnifyingGlassIcon} size="lg" />}
      title="No results found"
      description="Try adjusting your search or filters to find what you need."
      actions={<Button label="Clear filters" variant="secondary" />}
    />
  );
}

Usage

EmptyState shows a placeholder when a content area has no data. Use it for empty lists, zero search results, first-time setups, or cleared inboxes. Always include a title and a next step so the user is not stuck.

  • Include a clear title and a call-to-action button so users know how to proceed.
  • Use an illustration or icon that reinforces the context of the empty state.
  • Use the compact variant inside cards or sidebars where space is limited.
  • Leave an empty state without guidance; always explain what happened and what the user can do next.
  • Use a generic message like "No data"; be specific about what is empty and why.
  • Use an EmptyState for error messages that require immediate action; use a Banner instead.

Typed props

PropType and behavior
titlestring · required
Primary message rendered as an <h3> heading inside the empty state.
descriptionstring
Optional secondary text providing additional context below the title.
iconReactNode
Optional icon or illustration displayed above the title; rendered as decorative (aria-hidden="true").
Slot: Icon
actionsReactNode
Optional action buttons displayed below the description, laid out horizontally by default and stacked vertically when isCompact is true.
Slot: Button
headingLevel1 | 2 | 3 | 4 | 5 | 6 · default 3
Controls only the rendered HTML heading tag (h1-h6) so the title fits the document outline. This is a semantic change for accessibility and does not change the visual size of the title, which stays fixed regardless of level.
isCompactboolean · default false
Enables the compact variant with reduced spacing for constrained content areas.
xstyleStyleXStyles
StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}.

Anatomy

Icon · optional

A visual cue above the title that reinforces the context, like a search icon for no results.

Title · required

Primary message explaining what is empty: "No projects yet" not "No data".

Description · optional

Additional context explaining why it is empty or what the user can do.

Actions · optional

One or two buttons guiding the user to a next step, like "Create project" or "Clear filters".

Theming

Targets

astryx-empty-state

Visual props: variant

astryx-empty-state-title

Visual props: variant

astryx-empty-state-description

Visual props: variant