This guide will help you learn how to integrate custom components with MantineProvider and how to add Styles API support.
Add Styles API support
You will need to use createStyles to add Styles API support to any component:
useStyleshook that will be used in component with createStyles:
- Add styles to component with
Done! Styles API support was added to
MyComponent. You can now
styles and other system props:
You can also add
classNames on MantineProvider:
Add default props support
You can add default props support to any component with
Then you will be able to add default props on MantineProvider:
DefaultProps adds system props support (margin, padding, sx, unstyled, styles and classNames).
It accepts 2 types: styles names and styles params, both of them are optional.
When you build components there might be 4 cases: