Skip to main content
Version: 1.0.3

Empty State

The EmptyState component provides a flexible, composable interface for displaying "no data" or empty states. It supports various visual variants, custom illustrations, and entrance animations via Framer Motion.

Project status: inactive

No Projects Yet

You haven't created any projects. Get started by creating your first project to organize your work.

Installation

ignix add component empty-state

Usage

import {
EmptyState,
EmptyStateIllustration,
EmptyStateBadge,
EmptyStateHeading,
EmptyStateDesc,
EmptyStateActions,
EmptyStateHelp,
} from "@ignix-ui/empty-state";

Basic Usage

import { Button } from "@ignix-ui/button";
import { FileTextIcon } from "@radix-ui/react-icons";

<EmptyState>
<EmptyStateIllustration icon={FileTextIcon} />
<EmptyStateBadge label="0 results" />
<EmptyStateHeading title="No data available" />
<EmptyStateDesc>
There is no data to show right now.
</EmptyStateDesc>
<EmptyStateActions>
<Button variant="primary">
Create
</Button>
<Button variant="ghost">
Learn more
</Button>
</EmptyStateActions>
<EmptyStateHelp />
</EmptyState>

Presets

For common use cases, we provide pre-configured "presets" that simplify the implementation of standard empty states. These presets accept handlers for actions, allowing for a clean integration with your application logic.

Default Preset

The EmptyStateDefault preset is ideal for "no data" states where users are encouraged to create or import records.

import { EmptyStateDefault } from "@ignix-ui/empty-state";

function ProjectList() {
const handleCreate = () => {
// Logic to open create modal
};

const handleImport = () => {
// Logic to trigger import
};

return (
<EmptyStateDefault
onCreateProject={handleCreate}
onImport={handleImport}
helpHref="/docs/projects"
/>
);
}

Minimal Preset

The EmptyStateMinimal preset is designed for search results or filtered views where no items match the current criteria.

import { EmptyStateMinimal } from "@ignix-ui/empty-state";

function SearchResults({ onResetFilters }) {
return (
<EmptyStateMinimal
onClearFilters={onResetFilters}
/>
);
}

Props

EmptyState

PropTypeDefaultDescription
variant'default' | 'card' | 'minimal' | 'gradient''default'Visual variant of the empty state container
childrenReactNode-Content of the empty state
tiltbooleantrueEnables 3D tilt effect

EmptyStateIllustration

PropTypeDefaultDescription
iconElementTypeFileTextIconRadix icon to display
illustrationReactNode | string-Custom illustration or image URL. Overrides icon
iconSizenumber22Size of the icon in pixels
accent'primary' | 'teal' | 'amber''primary'Accent color for the illustration and background gradient

EmptyStateBadge

PropTypeDefaultDescription
labelstring-Badge text
dotbooleantrueDisplays a dot before the label

EmptyStateHeading

PropTypeDefaultDescription
titlestring"No data available"Heading text

EmptyStateDesc

PropTypeDefaultDescription
descriptionstring-Description text

EmptyStateHelp

PropTypeDefaultDescription
linkTextstring"Learn more"Text for the help link
hrefstring"#"URL for the help link
iconElementTypeQuestionMarkCircledIconIcon to display next to "Need help?"