Skip to content
Twentyfirst UIHalo

Data Table

Data · Avatar, Badge, DataTable, FilterBar

Table with the features list pages need: sorting, row selection with a bulk action bar, column toggles, sticky header and expandable rows. FilterBar sits above it.

DataTable props: columns ({key, label, render, align, sortable, sortValue(row), hideable, hidden, width}), rows, rowKey ("id"), selectable, bulkActions ({label, icon, danger, onClick(rows, clear)}), renderExpanded(row), stickyHeader, maxHeight, defaultSort ({key, dir}), toolbar, columnToggle (false hides), empty.
FilterBar props: filters ({key, label, icon, options}), value / onChange ({key: option}), search (placeholder), query / onQuery, right.

  • Sort cycles ascending → descending → off; the arrow only shows on the sorted or hovered column.
  • The bulk bar floats at the bottom of the table while rows are selected; destructive actions are red and go through an Undo toast or ConfirmDialog.
  • Active filters are ink chips you can click to change or × to remove. "Clear all" appears from two filters on.
  • The header checkbox shows a dash when some, not all, rows are selected.
  • Put it in tf-panel tf-panel-flush so cells line up at 24px with other panels.
2 of 5
AVAva VogelEditorEngineeringActive3
ESElif SatoEditorEngineeringAway2

Props

Avatar

PropTypeNotes
namestringRequired
src?string
size?number
tint?Tint | "surface-sunken"
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Badge

PropTypeNotes
tone?Tone
dot?boolean
live?boolean
children?ReactNode
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

DataTable

PropTypeNotes
columnsDataColumn<R>[]Required
rowsR[]Required
rowKey?string
selectable?boolean
bulkActions?{ label: string; icon?: IconName; danger?: boolean; onClick: (rows: R[], clear: () => void) => void; }[]
renderExpanded?(row: R) => ReactNode
stickyHeader?boolean
maxHeight?number | string
defaultSort?{ key: string; dir: "asc" | "desc" }
toolbar?ReactNode
columnToggle?boolean
empty?ReactNode
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

FilterBar

PropTypeNotes
filtersFilterDef[]Required
valueRecord<string, string>Required
onChange(v: Record<string, string>) => voidRequired
search?string
query?string
onQuery?(q: string) => void
right?ReactNode
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.