EmptyState
What a list, a table or a search shows when it has nothing. It says so and offers the next action.
Import
Copy code
import { EmptyState } from '@k8ordo/ui';Usage
No posts yet
Copy code
<EmptyState title="No posts yet" />Icon and action
No matching posts
Removing a filter may bring some back.
Copy code
<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.
| Name | Role |
|---|---|
No members yet | |
Copy code
<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: -
| Prop | Type | Default |
|---|---|---|
title | string | - |
action? | ReactNode | - |
description? | ReactNode | - |
icon? | ReactNode | - |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLDivElement>