Default props
You can define default props for every Mantine component by setting theme.components
on
MantineProvider:
Overriding default props
Default props defined on MantineProvider will be overridden with props that you set on component itself:
Default props based on theme
Default props for static components
Some components like Menu, Tabs and RichTextEditor
have associated static components: Menu.Item
, Tabs.List
, RichTextEditor.Toolbar
. You can add
default props to these components by omitting the dot from component name:
Usage with TypeScript
MantineProvider uses Record<string, any>
type for default props types to improve TypeScript performance.
If you need more strict type checks or want to have IDE autocomplete, you should define default props separately: