Empty State

Empty-state block with an icon or illustration slot, title, description, primary and secondary actions, three sizes and an optional dashed border; the default SVG art (a floating document stack or a search lens) draws in and drifts gently, and the whole block staggers in when scrolled into view.

Preview

Empty State preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/empty-state
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

EmptyStateIllustration

variant?
"search" | "documents"
documents
size?
number

Width in px; height follows the 5:4 viewBox.

120
className?
string
—

EmptyState

title
ReactNode
—
description?
ReactNode
—
icon?
ReactNode

Icon or illustration slot. Defaults to `<EmptyStateIllustration />`; pass `null` for none.

—
action?
ReactNode

Primary call to action (e.g. a library `Button`).

—
secondaryAction?
ReactNode

Secondary call to action, rendered after the primary.

—
size?
"sm" | "md" | "lg"
md
bordered?
boolean

Dashed border container, for empty regions inside a page.

false
titleAs?
"h2" | "h3" | "h4" | "p"

Heading element for the title. Default `h3`.

h3
children?
ReactNode

Extra content under the actions (links, hints).

—
className?
string
—

Updated