Loading component…
Loading component…
What a list, table or panel shows while it has nothing yet
To reuse this local React demo, copy all files from the Code tab into the same folder, then import EmptyState from ./empty-state.
import { Calendar03Icon, PlusSignIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { Button } from "@/components/ui/button";
import { EmptyState } from "@/components/ui/empty-state";
export function Schedules({ schedules, onNew }: { schedules: { id: string }[]; onNew: () => void }) {
if (!schedules.length) {
return (
<EmptyState
icon={Calendar03Icon}
title="No schedules yet"
text="Runs you ask an agent to repeat show up here, with their next time."
action={
<Button variant="secondary" size="sm" icon={<HugeiconsIcon icon={PlusSignIcon} size={16} />} onClick={onNew}>
New schedule
</Button>
}
/>
);
}
return null; // …the list
}| Name | Type | Default | Description |
|---|---|---|---|
| title | ReactNode | Required. What's empty, e.g. "No schedules yet" | |
| text | ReactNode | One line on what will show up here, or how to get there – balanced over two lines when it wraps | |
| action | ReactNode | The first step, usually a small secondary Button; several sit in a row and wrap | |
| icon | ReactNode \| HugeIcon | a file | The glyph on a small white card – an inline SVG or a Hugeicons icon object, drawn 20px at a 1.75 stroke; null leaves the card out |
| bare | boolean | false | Without the dashed frame – for a panel or page where it is the only content |
| tall | boolean | false | Fills its parent's height and centres itself in it – for a list or table area that keeps its size |
| ...div props | ComponentProps<"div"> | className, style, id, role, ref and the rest go to the outer <div> |
Centered and as wide as its parent; the text stops at 430px and wraps in balance
Long titles and unbroken words wrap instead of running out
Below 560px the frame tightens to 36px top and 18px at the sides
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.