Server-side DataTable

True server-side operations: pagination, sorting, filtering, and search all happen on the server. State persisted in URL.

How it works

  1. URL contains state: ?page=0&pageSize=10&sortBy=name&search=engineering
  2. Server Component parses URL → builds TableQuery
  3. fetchDemoTable(query) runs on server, returns paginated results
  4. Client renders with manualPagination + manualSorting + manualFiltering
  5. User changes → URL updates → server re-fetches (no client-side filtering)

Current Server Query

{
  "page": 0,
  "pageSize": 10
}

Users

Page 1 of 550 total users

10 of 50 users (server-paginated)
Alex Smith
alex.smith@example.com
EngineeringManagerActiveHigh
90%
Jan 1, 2023
Jordan Smith
jordan.smith@example.com
DesignManagerInactiveHigh
51%
Jan 8, 2023
Taylor Smith
taylor.smith@example.com
MarketingSenior DeveloperPendingHigh
72%
Jan 15, 2023
Morgan Smith
morgan.smith@example.com
SalesSenior DeveloperActiveMedium
83%
Jan 22, 2023
Casey Smith
casey.smith@example.com
OperationsDesignerInactiveMedium
44%
Jan 29, 2023
Riley Smith
riley.smith@example.com
FinanceDesignerPendingMedium
65%
Feb 5, 2023
Quinn Smith
quinn.smith@example.com
HRAnalystActiveLow
76%
Feb 12, 2023
Avery Smith
avery.smith@example.com
ProductAnalystInactiveLow
37%
Feb 19, 2023
Parker Smith
parker.smith@example.com
SupportCoordinatorPendingLow
58%
Feb 26, 2023
Charlie Smith
charlie.smith@example.com
LegalCoordinatorActiveHigh
99%
Mar 5, 2023
0 of 10 row(s) selected.

Rows per page

Page 1 of 5

Code Pattern

page.tsx (Server Component)

// Parse URL searchParams → TableQuery
const query = parseSearchParams(params);

// Fetch on server
const result = await fetchDemoTable(query);

// Pass to client with manual mode
<ServerDemoTable
  data={result.items}
  total={result.total}
  pageCount={result.pageCount}
  currentState={currentState}
/>

client-table.tsx ("use client")

<BaseDataTable
  data={data}
  manualPagination
  manualSorting
  manualFiltering
  pageCount={pageCount}
  externalState={currentState}
  onPaginationChange={updateURL}
  onSortingChange={updateURL}
  onGlobalFilterChange={updateURL}
/>

Command Palette

Search for pages, contacts, deals, or perform quick actions