Before making large PRs, you may want to discuss your proposals in either the Discord Contributing Channel, the GitHub Discussions page, or the GitHub Issues page.
This project uses PNPM and a TurboRepo with 2 projects.
- The library itself in
/packages/mantine-react-tablewhich also contains a storybook site for local development - The docs site in
/apps/mantine-react-table-docs
Create your own fork, clone, and then make a feature/bugfix branch off of main. Branch name does not really matter.
pnpm ipnpm storybookThe Storybook site will open on port 6007 by default.
pnpm docs:devThe Docs site will open on port 3001 by default.
Note: If you are contributing a new locale and are trying to test it in the docs site, you will need to run
pnpm lib:build-localesand thenpnpm docs:devbefore it can be imported.
If you are just using Storybook for local development you don't need to do this, but if you want to see library code changes while running the docs you'll need to have the library run in watch mode:
In a 2nd terminal, run:
pnpm lib:devAlternatively, you can just run pnpm dev in just 1 terminal and both the library and docs will run in dev mode for development
pnpm lib:buildNote: After building the library, if you are running the docs site locally, it will use the compiled output of the dist folder. This can be annoying if you are trying to test changes to the library in the docs site itself. Just delete the
/distfolder to test lib changes in the docs site.
- All styles should be written in
.module.cssfiles with a file name that matches thecomponent.tsxfile name. - All dynamic styles should be handed with CSS variables (
__varsprop) - CSS variables should be named
--mrt-<component/element-name>-<property-name>(e.g.--mrt-tbody-display) in order to avoid name collisions with elements down the tree. - Class names in
.module.cssfiles don't really matter since they get compiled away, but just use all lowercase and hyphenated (e.g.table-cell). Just use.rootfor the root element, and use other names that make sense for sub-elements. - All major elements in internal MRT components should have an
mrt-<component/element-name>class name (e.g.mrt-table-body-cell). - Always use the
clsxutility to assign class names to elements. Always allow formantine*Props.classNameto be passed in and merged with the internal class names. For example
className={clsx('mrt-table-body', classes.root, tableBodyProps.className)}`- When assigning
__varsorstyles, don't forget to spread...mantine*Props.__varsin order to allow for external variables to be passed in and merged with internal variables. For example
__vars={{
'--mrt-table-body-cell-padding': '10px',
...tableBodyProps?.__vars,
}}