Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
493 changes: 493 additions & 0 deletions MIGRATION.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Material React Table V3
# Material React Table V4

View [Documentation](https://www.material-react-table.com/)

Expand Down Expand Up @@ -36,7 +36,7 @@ View [Documentation](https://www.material-react-table.com/)

### _Quickly Create React Data Tables with Material Design_

### **Built with [Material UI <sup>V6</sup>](https://mui.com) and [TanStack Table <sup>V8</sup>](https://tanstack.com/table/v8)**
### **Built with [Material UI <sup>V9</sup>](https://mui.com) and [TanStack Table <sup>V8</sup>](https://tanstack.com/table/v8)**

<img src="https://material-react-table.com/banner.png" alt="MRT" height="50" />

Expand Down Expand Up @@ -114,9 +114,9 @@ _**Fully Fleshed out [Docs](https://www.material-react-table.com/docs/guides#gui

View the full [Installation Docs](https://www.material-react-table.com/docs/getting-started/install)

1. Ensure that you have React 18 or later installed
1. Ensure that you have React 19 or later installed

2. Install Peer Dependencies (Material UI V6)
2. Install Peer Dependencies (Material UI V9)

```bash
npm install @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled
Expand All @@ -128,7 +128,7 @@ npm install @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react
npm install material-react-table
```

> _`@tanstack/react-table`, `@tanstack/react-virtual`, and `@tanstack/match-sorter-utils`_ are internal dependencies, so you do NOT need to install them yourself.
> _`@tanstack/react-table` v8.21, `@tanstack/react-virtual` v3.13, and `@tanstack/match-sorter-utils` v8.19_ are internal dependencies, so you do NOT need to install them yourself.

### Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const BlogAuthor = ({
alignItems: 'center',
}}
>
<Typography fontSize="14pt" variant="caption">
<Typography sx={{ fontSize: '14pt' }} variant="caption">
By{' '}
<Link
color="text.primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MRT_TableContainer,
type MRT_ColumnDef,
useMaterialReactTable,
} from 'material-react-table';
} from '@glebcha/material-react-table';

const columns: MRT_ColumnDef<(typeof data)[0]>[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MRT_ColumnDef,
MRT_TableContainer,
useMaterialReactTable,
} from 'material-react-table';
} from '@glebcha/material-react-table';

const columns: MRT_ColumnDef<any>[] = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MaterialReactTable, type MRT_ColumnDef } from 'material-react-table';
import { MaterialReactTable, type MRT_ColumnDef } from '@glebcha/material-react-table';

const columns: MRT_ColumnDef<(typeof data)[0]>[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const SourceCodeSnippet = ({
<LinkHeading
tableId={tableId}
variant="h4"
textTransform="capitalize"
sx={{ textTransform: 'capitalize' }}
>
Demo
</LinkHeading>
Expand Down Expand Up @@ -267,7 +267,7 @@ export const SourceCodeSnippet = ({
>
<LinkHeading
tableId={tableId}
textTransform="capitalize"
sx={{ textTransform: 'capitalize' }}
variant="h4"
>
Source Code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const Footer = () => {
p: '1.5rem',
}}
>
<Typography color="text.secondary" textAlign="center">
<Typography color="text.secondary" sx={{ textAlign: 'center' }}>
© {new Date().getFullYear()} Kevin&nbsp;Van&nbsp;Cott
</Typography>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const MiniNav = () => {
maxWidth: isXLDesktop ? '250px' : '500px',
}}
>
<Typography mt="1rem" component="div" variant="h6">
<Typography sx={{ mt: '1rem' }} component="div" variant="h6">
On This Page
</Typography>
<ul
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const SideBar = ({ navOpen, setNavOpen }: Props) => {

return (
<Drawer
PaperProps={{ component: 'aside' }}
slotProps={{ paper: { component: 'aside' } }}
open={navOpen}
onClose={() => setNavOpen(false)}
variant={isMobile ? 'temporary' : 'permanent'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
type MRT_ColumnDef,
type MRT_Cell,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Link as MuiLink, Typography, useMediaQuery } from '@mui/material';
import { SampleCodeSnippet } from '../mdx/SampleCodeSnippet';
import { type CellInstanceAPI, cellInstanceAPIs } from './cellInstanceAPIs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
type MRT_ColumnDef,
type MRT_Column,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Link as MuiLink, Typography, useMediaQuery } from '@mui/material';
import { SampleCodeSnippet } from '../mdx/SampleCodeSnippet';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useMemo, useState } from 'react';
import Link from 'next/link';
import { MaterialReactTable, type MRT_ColumnDef } from 'material-react-table';
import { MaterialReactTable, type MRT_ColumnDef } from '@glebcha/material-react-table';
import {
Link as MuiLink,
Typography,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
type MRT_ColumnDef,
type MRT_Row,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Link as MuiLink, Typography, useMediaQuery } from '@mui/material';
import { SampleCodeSnippet } from '../mdx/SampleCodeSnippet';
import { type RowInstanceAPI, rowInstanceAPIs } from './rowInstanceAPIs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
type MRT_ColumnDef,
type MRT_TableState,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Link as MuiLink, Typography, useMediaQuery } from '@mui/material';
import { SampleCodeSnippet } from '../mdx/SampleCodeSnippet';
import { type StateOption, stateOptions } from './stateOptions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
type MRT_ColumnDef,
type MRT_TableInstance,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Link as MuiLink, Typography, useMediaQuery } from '@mui/material';
import { SampleCodeSnippet } from '../mdx/SampleCodeSnippet';
import { type TableInstanceAPI, tableInstanceAPIs } from './tableInstanceAPIs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
type MRT_TableOptions,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import {
Link as MuiLink,
Typography,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_Cell } from 'material-react-table';
import { type MRT_Cell } from '@glebcha/material-react-table';

export interface CellInstanceAPI {
cellInstanceAPI: keyof MRT_Cell<CellInstanceAPI>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_Column } from 'material-react-table';
import { type MRT_Column } from '@glebcha/material-react-table';

export interface ColumnInstanceAPI {
columnInstanceAPI: keyof MRT_Column<ColumnInstanceAPI>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_ColumnDef } from 'material-react-table';
import { type MRT_ColumnDef } from '@glebcha/material-react-table';

export type ColumnOption = {
columnOption: keyof MRT_ColumnDef<ColumnOption>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_Row } from 'material-react-table';
import { type MRT_Row } from '@glebcha/material-react-table';

export interface RowInstanceAPI {
rowInstanceAPI: keyof MRT_Row<RowInstanceAPI>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_TableState } from 'material-react-table';
import { type MRT_TableState } from '@glebcha/material-react-table';

export type StateOption = {
defaultValue?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_TableInstance } from 'material-react-table';
import { type MRT_TableInstance } from '@glebcha/material-react-table';

export interface TableInstanceAPI {
tableInstanceAPI: keyof MRT_TableInstance<TableInstanceAPI>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_TableOptions } from 'material-react-table';
import { type MRT_TableOptions } from '@glebcha/material-react-table';

export type TableOption = {
defaultValue?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type MRT_ColumnDef,
MRT_GlobalFilterTextField,
MRT_ToggleFiltersButton,
} from 'material-react-table';
} from '@glebcha/material-react-table';

//Material UI Imports
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';

const Example = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';

const localeStringOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';

const Example = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Box, Typography, useMediaQuery } from '@mui/material';
import { data, type Person } from './makeData';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
MaterialReactTable,
useMaterialReactTable,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { columns, data } from './makeData';

const Example = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type MRT_ColumnDef } from 'material-react-table';
import { type MRT_ColumnDef } from '@glebcha/material-react-table';

export type Person = {
firstName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';

//example data type
type Person = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { useTheme } from '@mui/material/styles';
import { LineChart } from '@mui/x-charts/LineChart';
import { data, type Person } from './makeData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';

const Example = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';

const Example = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Divider, MenuItem } from '@mui/material';
import { data, type Person } from './makeData';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type MRT_ColumnDef,
MRT_TableContainer,
MRT_TableHeadCellFilterContainer,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';
import { Paper, Stack, useMediaQuery } from '@mui/material';

Expand Down Expand Up @@ -53,10 +53,10 @@ const Example = () => {
});

return (
<Stack direction={isMobile ? 'column-reverse' : 'row'} gap="8px">
<Stack sx={{ flexDirection: isMobile ? 'column-reverse' : 'row', gap: '8px' }}>
<MRT_TableContainer table={table} />
<Paper>
<Stack p="8px" gap="8px">
<Stack sx={{ padding: '8px', gap: '8px' }}>
{table
.getLeafHeaders()
.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
flexRender,
type MRT_ColumnDef,
useMaterialReactTable,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import {
Box,
Stack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MRT_ToggleDensePaddingButton,
MRT_ToggleFullScreenButton,
useMaterialReactTable,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { Box, Button, IconButton } from '@mui/material';
import PrintIcon from '@mui/icons-material/Print';
import { data, type Person } from './makeData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { data, type Person } from './makeData';

const Example = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';

export type Person = {
id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { MenuItem } from '@mui/material';
import { data, type Person } from './makeData';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
type MRT_ColumnDef,
} from 'material-react-table';
} from '@glebcha/material-react-table';
import { citiesList, data, type Person, usStateList } from './makeData';

const Example = () => {
Expand Down
Loading