Table

A set of composable table subcomponents for displaying structured, tabular data with sortable columns, row striping, and hover highlights.

Installation

npx dafink-ui add table

Demos

NameRoleStatus
Alice KimDesignerActive
Ben TorresEngineerActive
Clara PatelPMOn leave

Minimal variant

A flat, borderless look: no outer card border, no header fill, no zebra striping. Matches the docs site's PropsTable.

NameTypeDescription
labelstringVisible label above the field.
disabledbooleanPrevents interaction.

Composition

<Table>
<TableHead>
<TableRow>
<TableHeader />
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableCell />
</TableRow>
</TableBody>
</Table>

Props

NameTypeDefaultDescription
stripedbooleanfalseAlternates odd/even row background colors in the body. No effect when variant is "minimal".
variant'default' | 'minimal''default'Visual style. "minimal" is a flat, borderless look (matches the docs PropsTable) with no outer border or header fill.
classNamestring""Additional classes merged onto the table element.

Accessibility

Table has no component-specific keyboard behavior: every interactive piece is a native element in plain document order, with no roving tabindex and nothing to trap or escape. A sortable TableHeader wraps its label in a real button, so Tab reaches it like any other button and Enter/Space triggers the browser's own activation to cycle the sort; the header cell itself carries aria-sort (ascending/descending/none) reflecting the current state. Non-sortable headers and body cells are plain header/data cells with no additional roles.