Skip to content

Migrating from material-react-table

shadstack-table keeps the MRT API direction. The migration is a near-mechanical rename pass plus a slot-prop refactor; the React component tree, hook lifecycle, and TanStack Table state shapes are unchanged.

Terminal window
bun remove material-react-table @mui/material @mui/icons-material @emotion/react @emotion/styled
bun add shadstack-table

Replace the import:

import { MaterialReactTable, useMaterialReactTable, type MRT_ColumnDef } from 'material-react-table';
import { ShadStackTable, useShadStackTable, type SST_ColumnDef } from 'shadstack-table';
MRTshadstack-table
MaterialReactTableShadStackTable
useMaterialReactTableuseShadStackTable

Every type that started with MRT_ is now SST_ with the same shape.

import { type MRT_Row, type MRT_TableInstance } from 'material-react-table';
import { type SST_Row, type SST_TableInstance } from 'shadstack-table';

A find-and-replace of MRT_SST_ across your codebase covers this step; no type was renamed beyond the prefix.

If you read or write any of the built-in column IDs in state.columnOrder, state.columnPinning, custom column-order logic, etc., swap the mrt- prefix for sst-:

MRTshadstack-table
'mrt-row-select''sst-row-select'
'mrt-row-actions''sst-row-actions'
'mrt-row-expand''sst-row-expand'
'mrt-row-drag''sst-row-drag'
'mrt-row-numbers''sst-row-numbers'
'mrt-row-pin''sst-row-pin'
'mrt-row-spacer''sst-row-spacer'

Every MUI-prefixed slot prop on MRT_TableOptions lives under slotProps on SST_TableOptions. The renames are positional — muiTableBodyRowPropsslotProps.tableBodyRow, etc.

<MaterialReactTable
muiTableBodyRowProps={({ row }) => ({ className: cn(...) })}
muiTableHeadCellProps={{ align: 'center' }}
/>
<ShadStackTable
table={useShadStackTable({
slotProps: {
tableBodyRow: ({ row }) => ({ className: cn(...) }),
tableHeadCell: { className: 'text-center' },
},
})}
/>

A few specifics that catch people out:

  • MUI’s sx is gone. Use Tailwind utilities on className.
  • align="center" on table cells was an MUI prop; shadstack-table uses Tailwind text-alignment classes instead.

MRT consumed MUI’s theme. shadstack-table reads shadcn-style CSS variables (--background, --foreground, --primary, …). If you ran shadcn init already, you have them. Otherwise see Getting started → CSS setup.

A small set of MRT features ship later in the 0.x line — see Feature surface for the current list. The two most common gotchas:

  • filterVariant: 'autocomplete' falls back to a plain text input with a one-time console.warn on first render.
  • filterVariant: 'time' | 'datetime' | 'time-range' | 'datetime-range' uses a native <input> until a shadcn time-picker recipe lands. date and date-range already use the shadcn Popover + Calendar.

If your MRT app relies on a deferred feature, please open an issue describing the use case — that helps us prioritize.