Skip to content

Empty State

What an empty list or page says: a title, one line on what goes here, and one action.

0.8 kB gzipSource Registry JSON

EmptyState playground

No deploys yet

Deploy robin to see its builds and logs here.

Props

as

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/empty-state.json

The CLI writes components/ikada/empty-state.tsx and merges the ikada theme into your CSS. Or take it from the package: import { EmptyState } from "@sproutboat/ikada";

Usage

import { EmptyState } from "@/components/ikada/empty-state";

<EmptyState
  icon={<RocketIcon />}
  title="No deploys yet"
  description="Deploy robin to see its builds and logs here."
  action={<Button variant="primary" size="sm">Deploy robin</Button>}
/>

Examples

With one action

A title, one line on what goes here, and one action. A second action means it is saying too much.

No deploys yet

Deploy robin to see its builds and logs here.

Nothing to do

When there is no action to take, the title and one line are enough.

No alerts

finch and wren are both healthy.

Title only

No sprouts in eu-west

Props

EmptyStateProps
PropTypeDescription
iconReactNodeIcon above the title, drawn on a soft tile.
titlerequiredReactNodeWhat is empty, as a short heading.
descriptionReactNodeOne line: what this list will hold or what to do next.
actionReactNodeOne action. A second one means the empty state is saying too much.
as"h2" | "h3" | "h4"Heading level of the title. Default `h3`.

Also takes every prop of Omit<ComponentProps<"div">, "title">.

Source: src/components/empty-state.tsx