@k8ordo/ui

EmptyState

What a list, a table or a search shows when it has nothing. It says so and offers the next action.

Import

ts
import { EmptyState } from '@k8ordo/ui';

Usage

No posts yet

tsx
<EmptyState title="No posts yet" />

Icon and action

No matching posts

Removing a filter may bring some back.
tsx
<EmptyState
  action={
    <Button color="base" size="sm" variant="outline">
      Clear filters
    </Button>
  }
  description="Removing a filter may bring some back."
  icon={<TableIcon size="lg" />}
  title="No matching posts"
/>

Table.EmptyState

Inside a table, use Table.EmptyState. It draws the same content in a row spanning the columns.

NameRole

No members yet

tsx
<Table.Root>
  <Table.Head>
    <Table.Row>
      <Table.HeaderCell>Name</Table.HeaderCell>
      <Table.HeaderCell>Role</Table.HeaderCell>
    </Table.Row>
  </Table.Head>
  <Table.Body>
    <Table.EmptyState colSpan={2} title="No members yet" />
  </Table.Body>
</Table.Root>

Props

title
Type: string
Default: -
action?
Type: ReactNode
Default: -
description?
Type: ReactNode
Default: -
icon?
Type: ReactNode
Default: -
PropTypeDefault
titlestring-
action?ReactNode-
description?ReactNode-
icon?ReactNode-

Inherited attributes (except the ones set internally): HTMLAttributes<HTMLDivElement>

k8ordo

React libraries that use Baseline features without holding back.