EmptyState
A placeholder for content with nothing to show
Usage
import {EmptyState} from "@peakui/react";Omitted or empty children render the component's own default message, No results found.
Examples
Custom Message
With Icon
With Action
Customization
Tailwind CSS
The block ships no layout of its own: width, centering and gaps come from the consumer.
<EmptyState className="flex max-w-sm flex-col items-center gap-1 py-8 text-center">
Nothing here yet
</EmptyState>Global CSS
@layer components {
.empty-state {
@apply py-8 text-center;
}
}Styling Reference
PeakUI follows the BEM methodology, so variants and states are plain class names you can target.
CSS Classes
The EmptyState component uses this CSS class (view source styles):
.empty-state- Base styles with compact padding and muted text
Slots
[data-slot="empty-state"]- The root element
API Reference
EmptyState
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | "No results found" | Content; the default message renders when children is omitted or empty |
className | string | - | Additional classes |
render | DOMRenderFunction<'div', undefined> | - | Replaces the rendered <div> with your own element |
Every other attribute of a <div> is accepted.