This is the install guide for
@mantine/packages V7. MRT V2 will not work with Mantine V6.
mantine-react-tableV2 requires Mantine V7.3+ packages as dependencies in your project.
If you are already using Mantine, you probably already have most of these peer dependencies installed.
Just double-check that you have the following in your package.json, or use the full install commands below.
The Quick Install instructions here assume you already have Mantine V7 installed and correctly configured with postcss in your project.
Install With Required Peer Dependencies (Recommended)
It is best to refer to the Mantine V7 installation guide for the most up-to-date instructions on how to install Mantine V7 for your specific React meta framework. (Next.js, Remix, Vite, etc.)
Install Mantine React Table with Mantine required peer dependencies:
You do NOT need to install
@tanstack/react-table, as it is already an internal dependency of
mantine-react-table, and must use an exact version already specified internally.
All internal dependencies:
Install PostCSS dev dependencies (Optional)
If you are using Mantine V7, it is common to use CSS modules for advanced custom styling. You may want to install and configure PostCSS like down below, but it is not required if you are using a different styling solution.
postcss.config.cjs file in the root of your project with the following contents:
Setup Mantine Theme
The Mantine V7 installation guide has much better instructions for how to set up your Mantine theme, but you should have something like this in your project:
Import CSS Styles
After you install mantine-react-table, you will need to import the CSS styles from
mantine-react-table/styles.css at the root of your project. (Where you import your other Mantine CSS styles.)
If you don't see any styles applied to the mantine table components, you may have mismatching versions of
@mantine/core. MRT v1 requires Mantine v6 and will not work with Mantine v7. MRT v2 will be released by the end of 2023 and will work with Mantine v7.
Also, if the Action Icon Buttons all have a filled color, that is a good sign that you simply forgot to import the MRT CSS file in the step above.
If you get an error like this:
You probably do not have the correct version of Mantine or Tabler Icons installed.
Make sure all mantine packages are at least v7.3.
Make sure that the
@tabler/icons-react package is at least v2.23.0.
If you are using an older version of
create-react-app and get an error like this:
Then try upgrading either
react-scripts to the latest versions.