Header Renderer

Customize column headers with headerRenderer.

Add a header renderer

Set headerRenderer on a column to customize the header cell. Use header.label and other column fields from the props.

React TSX
const StatusHeader = ({ header }) => (
<span style={{ fontWeight: 600 }}>{header.label}</span>
);
const columns: ReactColumnDef[] = [
{ accessor: "status", label: "Status", width: 120, headerRenderer: StatusHeader },
];

Reuse built-in components

Arrange components (labelContent, sortIcon, filterIcon, collapseIcon) so sort/filter keep working without reimplementing them.

React TSX
{
accessor: "name",
label: "Name",
sortable: true,
filterable: true,
headerRenderer: ({ components }) => (
<>
{components?.labelContent}
{components?.sortIcon}
{components?.filterIcon}
</>
),
}

Hide all headers

To hide the header row entirely, set hideHeader on the table. See the API Reference.

Example

Custom header controls with built-in sort/filter icons. Use Code or StackBlitz for the full example.

Props

Header Renderer Configuration

PropertyRequiredDescriptionExample
ColumnDef.headerRenderer
Optional
Custom header content. Framework adapters accept components or render functions; vanilla returns a string or DOM node.

Renderer arguments

HeaderRendererProps

PropertyRequiredDescriptionExample
accessor
Required
The column accessor/key identifying which column this header belongs to
colIndex
number
Required
The zero-based index of the column within the table
header
Required
The complete ColumnDef containing all configuration for this column including label, width, and other properties
components
HeaderRendererComponents
Optional
Object containing pre-rendered header components (sortIcon, filterIcon, collapseIcon, labelContent) that can be positioned anywhere in your custom header renderer. This gives you complete control over the layout and order of header elements.