Minimal Example
Material React Table gives you a lot out of the box, but it's also easy to turn off any features that you do not need.
Every feature has an enable...
prop that let's you turn it on or off.
For example, you can turn off sorting or hide the top or bottom toolbars if you want.
First Name | Last Name | Address | City | State |
---|---|---|---|---|
Dylan | Murray | 261 Erdman Ford | East Daphne | Kentucky |
Raquel | Kohler | 769 Dominic Grove | Columbus | Ohio |
Ervin | Reinger | 566 Brakus Inlet | South Linda | West Virginia |
Brittany | McCullough | 722 Emie Stream | Lincoln | Nebraska |
Branson | Frami | 32188 Larkin Turnpike | Charleston | South Carolina |
1import React, { useMemo } from 'react';2import { MaterialReactTable, type MRT_ColumnDef } from 'material-react-table';3import { data, type Person } from './makeData';45export const Example = () => {6 const columns = useMemo<MRT_ColumnDef<Person>[]>(7 //column definitions...32 );3334 return (35 <MaterialReactTable36 columns={columns}37 data={data}38 enableColumnActions={false}39 enableColumnFilters={false}40 enablePagination={false}41 enableSorting={false}42 enableBottomToolbar={false}43 enableTopToolbar={false}44 muiTableBodyRowProps={{ hover: false }}45 muiTableProps={{46 sx: {47 border: '1px solid rgba(81, 81, 81, 1)',48 },49 }}50 muiTableHeadCellProps={{51 sx: {52 border: '1px solid rgba(81, 81, 81, 1)',53 },54 }}55 muiTableBodyCellProps={{56 sx: {57 border: '1px solid rgba(81, 81, 81, 1)',58 },59 }}60 />61 );62};6364export default Example;65
View Extra Storybook Examples