Examples
No data and no results
Explain whether content has not been created or a search/filter returned no matches.
No projects yet
Create a project to keep its tasks and reports together.
No matching projects
Try a shorter name or remove one of the filters.
Empty collection and no search results
import { Button } from "@phuctech/ui/components/button";
import { EmptyState } from "@phuctech/ui/components/empty-state";
export function Example() {
return (
<div className="grid w-full gap-4">
<EmptyState kind="empty" heading="No projects yet" description="Create a project to keep its tasks and reports together." action={<Button type="button">Create project</Button>} />
<EmptyState kind="no-results" heading="No matching projects" description="Try a shorter name or remove one of the filters." action={<Button type="button" variant="outline">Clear filters</Button>} />
</div>
);
}
Try the props
Choose the reason for the empty result and an optional next action.
No matching projects
Try a shorter name or remove one of the filters.
EmptyState property playground
import { EmptyState } from "@phuctech/ui/components/empty-state";
import { Button } from "@phuctech/ui/components/button";
export function Example() {
return <EmptyState kind="no-results" heading="No matching projects" description="Try a shorter name or remove one of the filters." action={<Button type="button">Clear filters</Button>} />;
}When to use
Use kind="empty" when a collection has not been created yet and kind="no-results" when the current search or filters match nothing. The feature owns the underlying query and any action behavior.
Usage
import { EmptyState } from "@phuctech/ui/components/empty-state";
import { Button } from "@phuctech/ui/components/button";
<EmptyState kind="empty" heading="No projects yet" description="Create a project to get started." action={<Button type="button">Create project</Button>} />API
Tokens
Accessibility
The section is a named region linked to its heading. The default icon is decorative. Actions remain regular controls with their own accessible names and keyboard behavior.
Do and don’t
Explain whether content is absent or the current query has no matches.
Use an empty state to represent loading or a failed request.