Shadcn React Table

Search documentation

Search the docs

Display modes

Several features expose a *DisplayMode option that changes how the UI is presented without changing the underlying behavior. Each defaults to the current look, so setting them is always opt-in.

Pagination display mode

paginationDisplayMode controls the pagination control style:

  • "default" — a start–end of total range label with first / previous / next / last buttons.
  • "pages" — numbered page buttons (with previous / next and collapsed ellipses for long ranges).
  • "custom" — renders nothing; supply your own via renderBottomToolbarCustomActions.
tsx
const table = useDataTable({
  data,
  columns,
  paginationDisplayMode: "pages",
})
Numbered pagesNumbered page buttons above and below the table.
GitHub
Rows per page
ID
AvaThompsonOwnerEngineeringactive22$45,000Jan 2, 2023
0%
LiamNguyenAdminMarketinginactive25$47,137Jan 13, 2023
9%
NoahSilvaEditorDesignpending28$49,274Jan 24, 2023
18%
EmmaCarterViewerSalesactive31$51,411Feb 4, 2023
27%
OliviaRossiOwnerSupportinactive34$53,548Feb 15, 2023
36%
$10,578,180
Rows per page

Column filter display mode

columnFilterDisplayMode controls where per-column filter inputs live:

  • "subheader" — a filter row beneath the header (toggled by the toolbar funnel button).
  • "popover" — a filter button on each filterable column header that opens the filter in a popover. The toolbar funnel and the "filter by" menu item are hidden in this mode.
  • "custom" — neither is rendered; supply your own filter UI per column via meta.renderColumnFilter.
tsx
const table = useDataTable({
  data,
  columns,
  columnFilterDisplayMode: "popover",
})
Popover filtersExcel-style filter buttons in the headers.
GitHub
ID
AvaThompsonOwnerEngineeringactive22$45,000Jan 2, 2023
0%
LiamNguyenAdminMarketinginactive25$47,137Jan 13, 2023
9%
NoahSilvaEditorDesignpending28$49,274Jan 24, 2023
18%
EmmaCarterViewerSalesactive31$51,411Feb 4, 2023
27%
OliviaRossiOwnerSupportinactive34$53,548Feb 15, 2023
36%
WilliamWalkerAdminEngineeringpending37$55,685Feb 26, 2023
45%
SophiaPatelEditorMarketingactive40$57,822Mar 9, 2023
54%
JamesMullerViewerDesigninactive43$59,959Mar 20, 2023
63%
IsabellaParkOwnerSalespending46$62,096Mar 31, 2023
72%
LucasReyesAdminSupportactive49$64,233Apr 11, 2023
81%
$4,120,536
Rows per page
1–10 of 48
Filter sidebarThe column filters in a sidebar of your own.
GitHub
AvaOwnerGermany22
LiamAdminJapan25
NoahEditorUSA28
EmmaViewerFrance31
OliviaOwnerItaly34
WilliamAdminCanada37
SophiaEditorNorway40
JamesViewerPortugal43
IsabellaOwnerGermany46
LucasAdminJapan49
Rows per page
1–10 of 48

Create display mode

createDisplayMode decouples the create form from editDisplayMode:

  • "modal" — the create form opens in a dialog (default).
  • "row" — an inline editable row appears at the top of the table, with Save / Cancel beneath it.
  • "custom" — nothing is rendered; build your own UI from the isCreating / rowDraft instance state.
tsx
const table = useDataTable({
  data,
  columns,
  enableEditing: true,
  createDisplayMode: "row",
  onCreatingRowSave: ({ values, exit }) => {
    // persist the new row, then:
    exit()
  },
})

// trigger the create form from a toolbar action:
// table.beginCreate()

editDisplayMode is independent

createDisplayMode only affects the create flow. You can edit existing rows inline (editDisplayMode: "row") while creating new ones in a modal, or any other combination.

Relevant options

PropTypeDefaultDescription
paginationDisplayMode?PaginationDisplayMode"default"Pagination control style: `"default"` (range label + first/prev/next/last buttons), `"pages"` (numbered page buttons), or `"custom"` (render your own via `renderBottomToolbarCustomActions`). Default "default".
columnFilterDisplayMode?ColumnFilterDisplayMode"subheader"Where column filter inputs live: `"subheader"` (a filter row under the header, default), `"popover"` (per-column popovers opened from the column header), or `"custom"` (you render them).
createDisplayMode?CreateDisplayMode"modal"How the create form is surfaced, independent of `editDisplayMode`: `"modal"` (dialog, default), `"row"` (an inline editable row at the top of the table), or `"custom"` (you render it from `isCreating` + `rowDraft`).