Skip to content
Klarhimmel UI

Empty state

No bookings yet

Bookings appear here as soon as a guest reserves a room.

npx shadcn add @klarhimmel/empty-state @klarhimmel/button

Examples

  • 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.

empty-state.tsx
import { Inbox } from 'lucide-react';
import { Theme } from '@/components/klarhimmel/theme/style';
import { Button } from '@/components/klarhimmel/ui/button';
import { EmptyState } from '@/components/klarhimmel/ui/empty-state';

export default function Example() {
  return (
    <Theme theme="brand">
      <EmptyState icon={<Inbox />} title="No bookings yet" action={<Button>Add a booking</Button>}>
        Bookings appear here as soon as a guest reserves a room.
      </EmptyState>
    </Theme>
  );
}

Import

Import

import { EmptyState } from '@/components/klarhimmel/ui/empty-state';
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

PropTypeDefaultDescription
iconReactNode-A lucide icon element.
titleReactNoderequiredRequired. The heading.
descriptionReactNode-One sentence: what this place is for and what to do. Same as children.
childrenReactNode-One sentence under the title.
actionReactNode-The one next step, usually a Button.
level2 | 3 | 43Heading level of the title, to fit the page outline.
classNamestring-Extra classes, merged after the component's own.

Accessibility

KeyDoes
TabMoves to the action button, if there is one
Enter / SpaceActivates 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