Import
import { Table } from '@k8ordo/ui';Usage
| Feature | Status | Coverage |
|---|---|---|
| Switch | Stable | 100% |
| Table | Planned | 0% |
<Table.Root>
<Table.Head>
<Table.Row>
<Table.HeaderCell>Feature</Table.HeaderCell>
<Table.HeaderCell>Status</Table.HeaderCell>
<Table.HeaderCell align="right">Coverage</Table.HeaderCell>
</Table.Row>
</Table.Head>
<Table.Body>
<Table.Row interactive>
<Table.Cell>Switch</Table.Cell>
<Table.Cell>Stable</Table.Cell>
<Table.Cell align="right">100%</Table.Cell>
</Table.Row>
</Table.Body>
</Table.Root>Empty table
When there is no data, put Table.EmptyState in Table.Body. Pass the number of columns as colSpan, and it draws an EmptyState in a row spanning them all.
| Name | Role | Projects |
|---|---|---|
No records have been added yet. Invite a teammate to get started. | ||
<Table.Root>
<Table.Head>
<Table.Row>
<Table.HeaderCell>Name</Table.HeaderCell>
<Table.HeaderCell>Role</Table.HeaderCell>
<Table.HeaderCell align="right">Projects</Table.HeaderCell>
</Table.Row>
</Table.Head>
<Table.Body>
<Table.EmptyState
colSpan={3}
description="Invite a teammate to get started."
title="No records have been added yet."
/>
</Table.Body>
</Table.Root>Props
Table.Root
children?- Type:
ReactNode - Default: -
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
Inherited attributes (except the ones set internally): TableHTMLAttributes<HTMLTableElement>
Table.Caption
children?- Type:
ReactNode - Default: -
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLTableCaptionElement>
Table.Head
children?- Type:
ReactNode - Default: -
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLTableSectionElement>
Table.Body
children?- Type:
ReactNode - Default: -
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLTableSectionElement>
Table.Row
children?- Type:
ReactNode - Default: -
interactive?- Type:
boolean - Default:
false selected?- Type:
boolean - Default:
false
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
interactive? | boolean | false |
selected? | boolean | false |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLTableRowElement>
Table.HeaderCell
align?- Type:
CellAlign - Default:
'left' children?- Type:
ReactNode - Default: -
scope?- Type:
'col'|'row'|'colgroup'|'rowgroup' - Default:
'col'
| Prop | Type | Default |
|---|---|---|
align? | CellAlign | 'left' |
children? | ReactNode | - |
scope? | 'col'|'row'|'colgroup'|'rowgroup' | 'col' |
Inherited attributes (except the ones set internally): ThHTMLAttributes<HTMLTableCellElement>
Table.Cell
align?- Type:
CellAlign - Default:
'left' children?- Type:
ReactNode - Default: -
color?- Type:
'base'|'mute' - Default:
'base'
| Prop | Type | Default |
|---|---|---|
align? | CellAlign | 'left' |
children? | ReactNode | - |
color? | 'base'|'mute' | 'base' |
Inherited attributes (except the ones set internally): TdHTMLAttributes<HTMLTableCellElement>
Table.EmptyState
colSpan- Type:
number - Default: -
title- Type:
string - Default: -
action?- Type:
ReactNode - Default: -
description?- Type:
ReactNode - Default: -
icon?- Type:
ReactNode - Default: -
| Prop | Type | Default |
|---|---|---|
colSpan | number | - |
title | string | - |
action? | ReactNode | - |
description? | ReactNode | - |
icon? | ReactNode | - |
Inherited attributes (except the ones set internally): ComponentProps<typeof EmptyState>