Loading state

Set progressPending to true while your data is in-flight. DataTable adapts its loading UI based on whether rows are already visible:

  • Initial load (no data yet): shimmer skeleton rows fill the body so the layout doesn't collapse.
  • Re-fetch (rows already shown): existing rows stay in place, dim to 40% opacity, and a spinner overlays the centre. The header and pagination never disappear.

Loading state

Click either button to see the two loading modes.

Name
Department
Salary
Status
Aria Chen
Engineering
$155,000
Active
Marcus Webb
Product
$132,000
Remote
Priya Kapoor
Design
$118,000
Active
Jordan Ellis
Analytics
$143,000
On Leave
Sam Rivera
Engineering
$128,000
Contractor

Custom spinner or message

The default progressComponent is a CSS spinner circle. Pass any React node to replace it. It will be centred in the overlay during re-fetches, or shown instead of skeletons on initial load.

<DataTable
  progressPending={loading}
  progressComponent={<MyBrandSpinner size={40} />}
/>

Empty state

When progressPending is false and data is empty, the noDataComponent is shown instead.

<DataTable
  data={[]}
  progressPending={false}
  noDataComponent={<p>No results match your search.</p>}
/>

Header visibility

The column header always stays visible during progressPending. Use persistTableHead to also keep it visible when data is empty and not loading.

// Keep header visible when data is empty (e.g. after a filter returns nothing)
<DataTable persistTableHead data={[]} columns={columns} />