Cell rendering

Every column has three ways to control what renders in its cells: selector for plain data access, format for display transforms, and cell for full custom React renderers.

selector, format, and cell

PropReturnsAffects sort?Use for
selector Primitive | ReactNode Yes Simple data access. Source of truth for sorting.
format ReactNode No Formatting (currency, dates) without breaking sort order.
cell ReactNode No Full custom renderers: badges, avatars, action buttons.

When cell is provided it takes priority over selector and format for rendering. For sortable columns with a custom cell, always provide selector returning a Primitive so sorting has a value to compare.

// ✅ Sortable column with a custom badge cell
{
  name: 'Status',
  selector: row => row.status,                         // sort key
  cell: row => <StatusBadge status={row.status} />,    // display
  sortable: true,
}

// ✅ Currency column — format preserves sort order
{
  name: 'Salary',
  selector: row => row.salary,                         // sort on raw number
  format: row => `$${row.salary.toLocaleString()}`, // display formatted
  sortable: true,
  right: true,
}

Action button cells

Set button: true on a column to center the content and prevent clicks from bubbling to onRowClicked. Use this for edit / delete / view action columns.

{
  name: '',
  cell: row => <button onClick={() => openProfile(row)}>View</button>,
  button: true,
  width: '100px',
}

Alignment and sizing

PropEffect
rightRight-align cell content.
centerCenter cell content.
widthFixed column width, e.g. "120px". Overrides flex sizing.
minWidthMinimum width before shrinking.
maxWidthMaximum width before growing stops.
growFlex-grow factor. Default 1. Set to 0 to prevent growing.
wrapAllow text to wrap inside the cell.
compactRemove cell padding for dense layouts.

Overflow and portals

By default DataTable clips cell overflow so rows stay a consistent height. If a cell contains a dropdown menu or popover that needs to break out, set allowOverflow: true on that column.

{
  name: 'Actions',
  cell: row => <ActionsMenu row={row} />,
  allowOverflow: true,
  button: true,
}

Suppressing row click in a cell

ignoreRowClick: true prevents clicks in the cell from firing onRowClicked. Useful for inline controls (toggles, links) inside a clickable row.

Custom cells — avatar, currency format, status badge, action button

Each column demonstrates a different cell technique: a composite avatar+name renderer, format() for currency and dates, a status badge via cell(), and an action button column.

Employee
Salary
Joined
Status
AC
Aria Chen
Engineering
$142,000
Mar 15, 2021
Active
JE
Jordan Ellis
Analytics
$134,000
Nov 20, 2019
Active
MW
Marcus Webb
Product
$128,000
Jul 1, 2020
Active
PK
Priya Kapoor
Design
$115,000
Jan 10, 2022
On Leave
SR
Sam Rivera
Engineering
$98,000
May 3, 2018
Terminated
TB
Taylor Brooks
Sales
$89,000
Feb 14, 2023
Active