Component reference
EmptyState
Guide users toward creating their first project.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Projects
The first-run state of a workspace with a single primary action.
Create your first project
Projects keep deployments, tokens and environments together. You can rename or archive one at any time.
Search
A result-less search that explains the filters and offers a way out.
No components match “modal”
Try a different term, or clear the filters to browse the whole library.
Inbox
A positive empty state: there is nothing left to do.
Inbox zero
You have read every notification.
Billing
A neutral state with no action, for a section that fills itself later.
No invoices yet
Your first invoice will be generated at the end of the billing period.
Width adapts to the available space
"use client";
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
EmptyState,
Button
} from "@pimolu/react";
type Illustration = "projects" | "search" | "inbox" | "billing";
function EmptyIllustration({ kind, }: {
kind: Illustration;
}) {
const common = {
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 1.7,
strokeLinecap: "round" as const,
strokeLinejoin: "round" as const,
"aria-hidden": true,
focusable: false,
};
if(kind === "search") {
return (
<svg {...common}>
<circle cx="11" cy="11" r="6.5" />
<path d="m16 16 4 4" />
<path d="M8.5 11h5" />
</svg>
);
}
if(kind === "inbox") {
return (
<svg {...common}>
<path d="M4 5h16l2 9v5H2v-5l2-9Z" />
<path d="M2 14h5l1.5 2h7L17 14h5" />
</svg>
);
}
if(kind === "billing") {
return (
<svg {...common}>
<rect x="3" y="5" width="18" height="14" rx="2" />
<path d="M3 10h18" />
<path d="M7 15h4" />
</svg>
);
}
return (
<svg {...common}>
<path d="M4 7.5 12 3l8 4.5-8 4.5-8-4.5Z" />
<path d="M4 12.5 12 17l8-4.5" />
<path d="M4 17.5 12 22l8-4.5" />
</svg>
);
}
export function DemoExample() {
return (
<div
className="grid grid-cols-[repeat(auto-fit,minmax(min(100%,280px),1fr))] gap-6 min-w-0 items-start"
>
<Card>
<CardHeader>
<CardTitle>Projects</CardTitle>
<CardDescription>
The first-run state of a workspace with a single primary action.
</CardDescription>
</CardHeader>
<CardContent>
<EmptyState
size="lg"
icon={<EmptyIllustration kind="projects" />}
title="Create your first project"
description={(
"Projects keep deployments, tokens and environments together. " +
"You can rename or archive one at any time."
)}
actions={<>
<Button>New project</Button>
<Button appearance="outline">Import from GitHub</Button>
</>}
/>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Search</CardTitle>
<CardDescription>
A result-less search that explains the filters and offers a way
out.
</CardDescription>
</CardHeader>
<CardContent>
<EmptyState
icon={<EmptyIllustration kind="search" />}
title="No components match “modal”"
description="Try a different term, or clear the filters to browse the whole library."
actions={<Button
appearance="outline"
>
Clear filters
</Button>}
/>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Inbox</CardTitle>
<CardDescription>
A positive empty state: there is nothing left to do.
</CardDescription>
</CardHeader>
<CardContent>
<EmptyState
size="sm"
icon={<EmptyIllustration kind="inbox" />}
title="Inbox zero"
description="You have read every notification."
/>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Billing</CardTitle>
<CardDescription>
A neutral state with no action, for a section that fills itself
later.
</CardDescription>
</CardHeader>
<CardContent>
<EmptyState
icon={<EmptyIllustration kind="billing" />}
title="No invoices yet"
description="Your first invoice will be generated at the end of the billing period."
/>
</CardContent>
</Card>
</div>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Sizes
sm, md and lg scale the padding, the illustration and the typography.
Without an icon
The illustration is optional; the heading and the description still carry the message.
Projects
A projects composition using EmptyState.
Usage
Explain why the view is empty and offer an actionable next step.
API reference
Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.
PimoluEmptyStateProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
icon | ReactNode | — | Decorative illustration or icon, hidden from assistive technology. |
titleRequired | ReactNode | — | Required heading, rendered as an h3. |
description | ReactNode | — | Optional supporting text. |
actions | ReactNode | — | Actions rendered below the description. |
size | "sm" | "md" | "lg" | undefined | "md" | Scales the padding, the illustration and the typography. |
onChange | ChangeEventHandler<HTMLElement, Element> | undefined | — | Standard React/HTML attribute. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onClick | MouseEventHandler<HTMLElement> | undefined | — | Standard React/HTML attribute. |
iconReactNodeNo default extracted.
Decorative illustration or icon, hidden from assistive technology.
titleRequiredReactNodeNo default extracted.
Required heading, rendered as an h3.
descriptionReactNodeNo default extracted.
Optional supporting text.
actionsReactNodeNo default extracted.
Actions rendered below the description.
size"sm" | "md" | "lg" | undefinedDefault: "md"
Scales the padding, the illustration and the typography.
onChangeChangeEventHandler<HTMLElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLElement> | undefinedNo default extracted.
Standard React/HTML attribute.
Accessibility
- Do not rely on illustration alone; keep a clear heading and keyboard-accessible action.