Empty state
The panel a collection shows when it has no rows
action
No projects yet
A project holds your files, runs and settings.
icon
Nothing here
The folder is empty — new files land here.
title only
Loading…
Installation
npx shadcn@latest add @sudokw/components-empty-stateimport { EmptyState } from "@gpuixui/components";Usage
import { useState } from "react";
import { Card } from "@gpuixui/components";
import { EmptyState } from "@gpuixui/components/empty-state";
import { Button } from "@gpuixui/primitives";
export const ProjectsPanel = () => {
const [creating, setCreating] = useState(false);
if (creating) return <text>Create a project…</text>;
return (
<Card>
<EmptyState
title="No projects yet"
description="A project holds your files, runs and settings."
action={
<Button variant="primary" onClick={() => setCreating(true)}>
New project
</Button>
}
/>
</Card>
);
};Composition
EmptyState
├── icon
├── title
├── description
└── actionAPI reference
| Prop | Type | Default | Consequence |
|---|---|---|---|
title | string | required | the line a reader scans first; painted in foreground |
description | string | none | support copy under the title, wrapped at 360px |
action | ReactNode | none | the way out, usually a Button; the only focusable part |
icon | ReactNode | none | a decorative glyph above the title, painted in mutedForeground |
className | string | none | compiled through @gpuixui/tw, joined after the recipe |
style | StyleDesc | none | merged last, so a caller overrides any recipe property |
testId | string | none | stable locator |
Edit this page on GitHubapps/docs/content/docs/components/empty-state.mdx