Empty Content
Empty state with icon, title, description and call to action.
Installation
bun add @xerobi/ui
import { EmptyContent } from "@xerobi/ui/empty-content"This component is client-side. In Astro, hydrate it with a client directive.
Examples
Default
No results
Try a different search.
import { EmptyContent } from "@xerobi/ui/empty-content"
export function EmptyContentDefault() {
return <EmptyContent title="No results" description="Try a different search." />
}With action
No projects yet
Create a project to get started.
import { Button } from "@xerobi/ui/button"
import { EmptyContent } from "@xerobi/ui/empty-content"
export function EmptyContentAction() {
return <EmptyContent title="No projects yet" description="Create a project to get started." action={<Button>Create project</Button>} />
}API reference
EmptyContent
| Prop | Type | Description |
|---|---|---|
| title | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | |
| description | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | |
| imgUrl | string | |
| filled | boolean | Dashed, tinted surface instead of a bare layout. |
| action | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | |
| slotProps | { img?: DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> | undefined; title?: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, H... |
Styling hooks: [data-slot="empty-content"].