columns: [{ key, header, render?(row), align? }]; rowKey (default id) names the unique field.

NameRoleBananas
KevinBanana boss3
StuartGoggle polisher12

Compact. compact tightens the cell padding for dense lists. rowProps(row) adds attributes such as className or aria-selected to a row, and isRowHidden(row) hides a row with the hidden attribute while keeping it mounted, so filtering does not reload its images or reset its inputs.

NameRoleBananas
KevinBanana boss3
StuartGoggle polisher12
BobBanana taster1

Props

Table

  • columnsTableColumn[]

    Column definitions. See the TableColumn table below.

  • rowsobject[]

    Row data.

  • rowKeystring
    Default: 'id'

    Field holding each row’s unique key.

  • emptyReactNode
    Default: 'No data'

    Shown when there are no rows.

  • captionstring

    Screen-reader caption.

  • compactboolean
    Default: false

    Tighter cell padding.

  • isRowHidden(row) => boolean

    Hides a row with the hidden attribute but keeps it mounted, so filtering does not reload images or reset inputs.

  • rowProps(row) => HTMLAttributes<tr>

    Extra attributes for a row, e.g. className or aria-selected.

  • classNamestring
    Default: ''

    Extra classes for the root element.

TableColumn

  • keystring

    Unique key; also the row field shown when there is no render.

  • headerReactNode

    Column heading.

  • render(row) => ReactNode

    Custom cell content.

  • align'left' | 'center' | 'right'
    Default: 'left'

    Text alignment of the column.