Header API

TanStack's Header API Reference covers the header cell, the header row it sits in, and the helper that builds the header rows from a column tree. elm-table has the same two types, Header and HeaderGroup, and builds the rows with headerGroups rather than a method on a table instance. This page maps TanStack's entries onto ours; full signatures and doc comments live on the generated Table module page. For prose, see Headers and Header Groups.

Types

TanStack elm-table Notes
Header Header Opaque. Read it with the header* functions below.
HeaderGroup HeaderGroup A plain record: id, depth, headers. One rendered header row.
HeaderContext No render context. A header carries its ids and spans; the size reads take the Config and State they need.
constructHeader headerGroups Headers are produced by the header-group builders, never one at a time.
buildHeaderGroups headerGroups Also footerGroups, which is the same rows bottom row first.
AppHeaderContext React-only. No render context here either.

Header rows

Value What it returns
headerGroups The header rows of a table, top row first.
footerGroups The footer rows: the header rows, bottom row first.
flatHeaders Every header of every header row.
leafHeaders The leaf headers reachable from the top header row.
getLeafHeaders The descendants of one header, deepest first, with the header itself last.

Reading one header

Reader What it returns
headerId The header id. Placeholder headers get a compound id.
headerColumnId The id of the column this header renders.
headerColSpan How many leaf columns this header spans.
headerRowSpan How many header rows this header spans. 0 means a header above already covers this cell.
headerDepth Which header row this header belongs to, counted from 1 at the top.
headerIndex The header's position in its header row.
headerIsPlaceholder Is this a filler header standing in for a column that has no group at this level?
headerPlaceholderId How many placeholders for the same column came before this one.
headerSubHeaders The headers nested under this one.

The header text itself lives on the column: columnHeader and columnFooter, looked up with findColumn on headerColumnId. Both return a Maybe String, so a view usually falls back to the column id.

Header sizes

Value What it returns
getHeaderSize The width of a header: its column's size for a leaf header, the sum of the sub-header widths for a parent header.
getHeaderStart How far from the start of its header row a header begins. Pass the headers of the row the header belongs to.

Pinned header variants

When columns are pinned, a table is rendered as three column regions. Each of the four header lists above has a per-region form, so a sticky left block and a sticky right block can be rendered as their own tables.

TanStack names these regions start and end. The state field and these function names use left and right; only the generated header ids keep TanStack's start and end wording. See Column Pinning.