Empty state
No bookings yet
Bookings appear here as soon as a guest reserves a room.
npx shadcn add @klarhimmel/empty-state @klarhimmel/buttonCopy for AIExamples
Basic
Search
Compact
DetailsAbout, usage, props and more
What a list or page shows when there is nothing yet: an icon, one sentence and one next step.
When to use
Use for
A first-run list, an empty search, a cleared inbox.
Not for
Errors. Use a Banner. Not for loading. Use Skeleton.
Pairs with
Button, Card, lists and tables.
Preview
No bookings yet
Bookings appear here as soon as a guest reserves a room.
Import
Import
- Files
- empty-state.tsx, button.tsx, in components/klarhimmel/ui/. With it: editing, theme, utils. npm: radix-ui.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
icon | ReactNode | - | A lucide icon element. |
title | ReactNode | required | Required. The heading. |
description | ReactNode | - | One sentence: what this place is for and what to do. Same as children. |
children | ReactNode | - | One sentence under the title. |
action | ReactNode | - | The one next step, usually a Button. |
level | 2 | 3 | 4 | 3 | Heading level of the title, to fit the page outline. |
className | string | - | Extra classes, merged after the component's own. |
Accessibility
| Key | Does |
|---|---|
Tab | Moves to the action button, if there is one |
Enter / Space | Activates the action |
The title is a heading (level 3 by default; set level to fit the page outline). The icon is hidden from assistive tech.
Accessibility