Footer

A footer row renders below the body and above the pagination controls. Use it for totals, averages, counts, or any other summary that should always be visible alongside the data.

There are two ways to declare a footer:

  • Column-level footer — the 80% case. Add a footer field to any TableColumn. The footer row appears automatically when at least one visible column has one.
  • footerComponent prop — escape hatch. Replace the entire footer row with a custom component when you need multi-row summaries, custom layouts, or aggregates that span columns.

Column-level footers

Pass footer as either a static ReactNode or a function that receives the filtered+sorted rows and returns a node. Use the function form to compute aggregates — it sees exactly the rows the user sees in the body, so totals update automatically when you sort or filter.

Column footers — totals that track filtering

Use the department filter to narrow the rows. The count and salary/bonus totals in the footer update to match what's on screen.

Filter by department:
Name
Department
Salary
Bonus
Aria Chen
Engineering
$155,000
$12,000
Marcus Webb
Product
$132,000
$9,500
Priya Kapoor
Design
$118,000
$7,800
Jordan Ellis
Analytics
$143,000
$11,200
Sam Rivera
Engineering
$128,000
$9,000
Taylor Brooks
Engineering
$122,000
$8,400
Casey Morgan
Product
$108,000
$6,600
Alex Kim
Analytics
$137,000
$10,100
Morgan Lee
Design
$114,000
$7,200
Drew Park
Engineering
$141,000
$10,800

Each footer cell inherits its column's right, center, width, minWidth, and maxWidth — so totals line up under their column automatically, including after a resize or sort.

Server-side pagination: the rows argument to a footer function contains only the rows currently in the table (the current page). If you need true cross-page totals, use footerComponent and supply server-computed aggregates yourself.

Custom footer component

Pass footerComponent to replace the footer row entirely. The component receives { rows, columns } and can render whatever it likes — multi-stat summaries, action buttons, contextual copy, anything.

Custom footer component — multi-stat summary bar

The footer bar computes headcount, total salary, average salary, bonus total, and total compensation from the visible rows. Filter by department to see every stat update.

Filter by department:
Name
Department
Salary
Bonus
Aria Chen
Engineering
$155,000
$12,000
Marcus Webb
Product
$132,000
$9,500
Priya Kapoor
Design
$118,000
$7,800
Jordan Ellis
Analytics
$143,000
$11,200
Sam Rivera
Engineering
$128,000
$9,000
Taylor Brooks
Engineering
$122,000
$8,400
Casey Morgan
Product
$108,000
$6,600
Alex Kim
Analytics
$137,000
$10,100
Morgan Lee
Design
$114,000
$7,200
Drew Park
Engineering
$141,000
$10,800

When footerComponent is set it takes precedence over any column-level footer fields.

Controlling footer visibility

The showFooter prop overrides auto-detection:

  • showFooter — force the footer row on even if no column defines a footer.
  • showFooter={false} — suppress the footer entirely, overriding column footers and footerComponent. Useful for toggling the summary on and off.
  • Omitted (default) — auto: render when any visible column has footer or footerComponent is provided.

The footer is also automatically hidden during progressPending.

Styling

Use customStyles to override footer appearance:

const customStyles = {
  footer: {
    style: {
      backgroundColor: '#f8fafc',
      borderTop: '2px solid #94a3b8',
    },
  },
  footerCells: {
    style: {
      fontWeight: 700,
      color: '#0f172a',
    },
  },
};

<DataTable columns={columns} data={data} customStyles={customStyles} />

All built-in themes (including their dark modes) set a background.footer value that gives the footer a distinct surface color matching the header. When building a custom theme with createTheme, set background.footer to control it:

createTheme('my-theme', {
  background: {
    default: '#1a1a2e',
    header:  '#16213e',
    footer:  '#16213e',   // footer matches header
  },
}, 'default');

The CSS variable --rdt-color-footer-bg is emitted automatically when background.footer is set. You can also set it directly in a raw CSS-variable theme object. It falls back to --rdt-color-header-bg, then --rdt-color-bg.

Pinned columns

Footer cells in pinned columns stick to the table edge exactly like their body cells — no extra config required. Pinning offsets are computed from the same source as the rest of the table, so they stay aligned after resizing.

Tips

  • Match the footer's display format to the column's format function. If salaries render as $45,000, format the total the same way.
  • Use a static label (footer: 'Total') on the leftmost column and aggregate functions on numeric columns.
  • For multi-row footers, group subtotals, or any layout that doesn't map 1:1 to columns, reach for footerComponent — it renders inside a role="rowgroup" container for accessibility and has no constraints on its internal structure.