Breaking changes
The following changes are breaking. Note that although we've tried to include all breaking changes with migration guides in the list you still may experience undocumented changes. If you think that these changes worth including in this list, let us know by opening an issue on GitHub.
Migration to rem/em units
All Mantine components now use rem units. 1rem is considered to be 16px
with medium text size selected by user, all components will scale based on settings specified in browser.
theme.spacing, theme.radius, theme.fontSizes and other theme properties overrides
are now expected to be defined in rem. theme.breakpoints are expected to be defined in em units:
You can no longer use addition, subtraction, division, multiplication and other math operations
with theme values in createStyles and sx prop,
use calc instead:
Automatic px to rem conversion
If you use numbers in Mantine components props, they will be treated as px and converted to rem,
for example:
The same logic is applied to style props available in every component:
createStyles breaking changes
createStyles function no longer receives getRef
as a third argument. Use getStylesRef exported from @mantine/core package instead:
@mantine/notifications breaking changes
@mantine/notifications package no longer exports
NotificationsProvider component. Instead you should add Notifications component to any
part of your application. This change allows to avoid unnecessary rerenders of child components
when notifications state change. Also useNotifications hook is no longer exported from the package.
@mantine/rte package deprecation
@mantine/rte package is deprecated – it will no longer receive updates (last version will remain 5.x)
and it may no longer be compatible with @mantine/core and @mantine/hooks packages (6.x and later versions).
Migrate to @mantine/tiptap as soon as possible.
@mantine/dates breaking changes
All components from @mantine/dates package were rebuilt from scratch.
Note that the following list is not full as it is difficult to include all breaking changes
after a full package revamp – follow documentation of component that you use to find out about
all breaking changes.
- Styles API selectors of components were changed
- DatePickercomponent was renamed to- DatePickerInput
- Calendarcomponent was renamed to- DatePicker
- TimeInputcomponent was migrated to native- input[type="time"]as it provides better UX in most browsers
- TimeRangeInputcomponent was removed – it is no longer exported from the package
- DateRangePickerand- RangeCalendarcomponents were removed – you can now setup dates range picking in DatePicker and DatePickerInput
- amountOfMonthsprop was renamed to- numberOfColumnsin all components
- DatePickerInput(previously- DatePicker) component no longer supports- allowFreeInputprop – use DateInput component instead
- DatePicker(previously- Calendar) component no longer supports- dayClassNameand- dayStyleprops – use- getDayPropsinstead
Theme object changes
You can no longer define dateFormat and datesLocale in theme,
use components prop to specify format instead:
Modal and Drawer breaking changes
Modal and Drawer components props were renamed:
- withFocusReturn→- returnFocus
- overflow→- scrollAreaComponent(scroll now is always handled inside modal/drawer)
- overlayBlur→- overlayProps.blur
- overlayColor→- overlayProps.color
- overlayOpacity→- overlayProps.opacity
- exitTransitionDuration→- transitionProps.exitDuration
- transition→- transitionProps.transition
- transitionDuration→- transitionProps.duration
- transitionTimingFunction→- transitionProps.timingFunction
Modal styles API changes:
- modalselector was renamed to- content
Drawer styles API changes:
- drawerselector was renamed to- content
NumberInput breaking changes
NumberInput component types for value, defaultValue
and onChange props were changed. It now expects value to be number | '' (number or empty string) instead
of number | undefined. This change was made to address multiple bugs that happened because it was
not possible to differentiate controlled and uncontrolled NumberInput.
Pagination breaking changes
- Styles API selectors were changed
- Renamed/removed props:- itemComponent– removed, use- getItemPropsor static components instead
- getItemAriaLabel– removed, use- getItemPropsprop instead
- initialPage→- defaultValue
- page→- value
 
@mantine/spotlight breaking changes
Spotlight component was migrated to use Modal under the hood. Its Styles API selectors and some props names were changed – it now supports all Modal component props.
Renamed props:
- overlayBlur→- overlayProps.blur
- overlayColor→- overlayProps.color
- overlayOpacity→- overlayProps.opacity
- exitTransitionDuration→- transitionProps.exitDuration
- transition→- transitionProps.transition
- transitionDuration→- transitionProps.transition
- transitionTimingFunction→- transitionProps.timingFunction
Spotlight actions are now fully controlled:
- actionsprop no longer accept a callback function, only a list of actions
- To make register/remove features to work you will need to store actions in state
Other breaking changes
- Text no longer supports variant="link", use Anchor instead
- Input Styles API was changed – disabled,invalidandwithIconselectors are no longer available, they were migrated todata-disabled,data-invalidanddata-with-iconattributes
- PasswordInput Styles API was changed – invalidandwithIconselectors are no longer available, usedata-invalidanddata-with-iconattributes withinnerInputselector
- invalidprop was renamed to- errorin Input component
- FileInput, Select and MultiSelect components no longer support clearButtonLabelandclearButtonTabIndexprops, useclearButtonPropsinstead to add any extra props to the clear button
- @mantine/nextpackage no longer exports- NextLinkcomponent
- Checkbox.Group, Switch.Group and Radio.Group components no longer include Group – orientation,offsetandspacingprops are no longer supported. This change gives you more freedom on how to organize inputs layout.
- Chip.Group no longer includes Group– you need to manage layout on your side
- List component Styles API was changed, it no longer has withIconselector, usedata-with-iconattribute instead
- withFocusReturnprop was renamed to- returnFocusin Modal and Drawer components
- Card component now uses paddingprop instead ofpto offsetCard.Sectioncomponents
- RichTextEditor now depends on @tabler/icons-react(>=2.1.0) package instead of@tabler/icons
- @mantine/corepackage no longer exports- GroupedTransitioncomponent, use multiple Transition components instead
- use-scroll-lockhook is deprecated, all Mantine components now use react-remove-scroll
- ScrollArea.Autosize component prop maxHeightis removed, it is replaced withmahstyle prop
- SegmentedControl component Styles API was changed – labelActiveanddisabledselectors were removed (replaced withdata-activeanddata-disabledattributes onlabelselector),activeselector was renamed toindicator
- Notification component prop disallowCloseprop was renamed towithCloseButton, it also was changed in notifications system
- Tooltip component props transitionandtransitionDurationwere renamed totransitionProps
- Popover, HoverCard, Menu, Select, MultiSelect, ColorInput and Autocomplete components transition,transitionDurationandexitTransitionDurationprops were renamed totransitionProps
- Indicator component no longer has the props dot,showZeroandoverflowCount. Usedisabledandlabelinstead to recreate the previous behavior.
Variants and sizes on MantineProvider
You can now use MantineProvider to add variants to all Mantine components that support Styles API
and sizes to components that support size prop.
Variants:
Sizes:
Updated @mantine/dates package
@mantine/dates package was rebuilt from scratch, it now includes new components to
pick year, month
and dates. All new pickers support type prop that can be:
- default–- Date | null– user can pick one date
- multiple–- Date[]– user can pick any number of dates
- range–- [Date | null, Date | null]– user can pick a range of two dates
type="default" example with DatePickerInput component:
type="multiple" example with MonthPickerInput component:
type="range" example with YearPickerInput component:
DateTimePicker component
DateInput
YearPicker component
YearPickerInput
MonthPicker
MonthPickerInput
Calendar
Calendar component can now be used as a base for date pickers with custom logic.
For example, you can build week picker component with it:
| Mo | Tu | We | Th | Fr | Sa | Su | 
|---|---|---|---|---|---|---|
DatesProvider
DatesProvider component lets you set various settings that are shared across all
components exported from @mantine/dates package:
New PinInput component
Overlay component improvements
Overlay component now supports the following new features:
- You can now render childreninsideOverlay
- When centerprop is set overlay children will be centered vertically and horizontally
- New fixedprop controlsposition, when it is setposition: fixed, when it is not setposition: absolute
Modal and Drawer components improvements
Compound components
Modal and Drawer components
now expose compound components that can be used to build custom modals and drawers. This feature
allows you to have full control over the component rendering. Previous approach with single
Modal/Drawer component will still work the same way as before.
Built in ScrollArea
Modal and Drawer components now use ScrollArea component to handle scroll:
Modal offset
Modal component now supports xOffset and yOffset props
to control vertical and horizontal offsets of the modal content:
keepMounted prop
Components that use Transition now support keepMounted.
When keepMounted prop is set component will not be unmounted from the DOM and instead it will
be hidden with display: none styles.
keepMounted prop is supported by the following components:
Pagination component improvements
Pagination component now supports changing icons with props and compound components:
@mantine/spotlight improvements
Controlled actions
You can now fully control actions state:
Controlled search query
You can now fully control search query:
Other changes
- rightSectionof all inputs is now based on- sizeprop by default (previously it was a static value)
- Chip component now supports filled,outlineandlightvariants
- theme.headings.fontFamilynow fallbacks to- theme.fontFamilyif value is not defined on- MantineProvider
- @mantine/notifications package now exports notificationsobject that includes functions to show, update, hide, clean and clean queue
- @mantine/nprogress, @mantine/modals and @mantine/spotlight packages now exports nprogress,modalsandspotlightobjects with all package methods
- use-os hook now sets initial value in useLayoutEffectby default (configurable with option) to avoid hydration mismatches
- use-id hook now always generate random id when component is mounted to replace id generated by React.useIdhook. This change prevents browser from showing incorrect autocomplete suggestions for inputs.
- Timeline component now supports rootStyles API selector
- SegmentedControl component now supports readOnlyprop
- Kbd component now supports sizeprop
- use-form now supports form.getTransformedValueshandler
- Tooltip now has better color contrast with dark color scheme
- Highlight component now supports changing styles per highlighted substring
- JsonInput component now supports serializeanddeserializeprops to allow custom JSON formats
- Modals manager now supports type safe context modals
- @mantine/form now exports new matchesFieldvalidator
- form.getInputProps withErrorparameter is now true by default for all inputs
- New use-headroom hook