PeakUI

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

PropTypeDefaultDescription
childrenReactNode"No results found"Content; the default message renders when children is omitted or empty
classNamestring-Additional classes
renderDOMRenderFunction<'div', undefined>-Replaces the rendered <div> with your own element

Every other attribute of a <div> is accepted.

On this page