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 @asuikit/core package instead:
@asuikit/notifications breaking changes
@asuikit/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.
@asuikit/rte package deprecation
@asuikit/rte package is deprecated – it will no longer receive updates (last version will remain 5.x)
and it may no longer be compatible with @asuikit/core and @asuikit/hooks packages (6.x and later versions).
Migrate to @asuikit/tiptap as soon as possible.
@asuikit/dates breaking changes
All components from @asuikit/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 toDatePickerInputCalendarcomponent was renamed toDatePickerTimeInputcomponent was migrated to nativeinput[type="time"]as it provides better UX in most browsersTimeRangeInputcomponent was removed – it is no longer exported from the packageDateRangePickerandRangeCalendarcomponents were removed – you can now setup dates range picking in DatePicker and DatePickerInputamountOfMonthsprop was renamed tonumberOfColumnsin all componentsDatePickerInput(previouslyDatePicker) component no longer supportsallowFreeInputprop – use DateInput component insteadDatePicker(previouslyCalendar) component no longer supportsdayClassNameanddayStyleprops – usegetDayPropsinstead
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→returnFocusoverflow→scrollAreaComponent(scroll now is always handled inside modal/drawer)overlayBlur→overlayProps.bluroverlayColor→overlayProps.coloroverlayOpacity→overlayProps.opacityexitTransitionDuration→transitionProps.exitDurationtransition→transitionProps.transitiontransitionDuration→transitionProps.durationtransitionTimingFunction→transitionProps.timingFunction
Modal styles API changes:
modalselector was renamed tocontent
Drawer styles API changes:
drawerselector was renamed tocontent
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, usegetItemPropsor static components insteadgetItemAriaLabel– removed, usegetItemPropsprop insteadinitialPage→defaultValuepage→value
@asuikit/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.bluroverlayColor→overlayProps.coloroverlayOpacity→overlayProps.opacityexitTransitionDuration→transitionProps.exitDurationtransition→transitionProps.transitiontransitionDuration→transitionProps.transitiontransitionTimingFunction→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 toerrorin Input component- FileInput, Select and MultiSelect components no longer support
clearButtonLabelandclearButtonTabIndexprops, useclearButtonPropsinstead to add any extra props to the clear button @asuikit/nextpackage no longer exportsNextLinkcomponent- 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 toreturnFocusin 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 @asuikit/corepackage no longer exportsGroupedTransitioncomponent, use multiple Transition components insteaduse-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 @asuikit/dates package
@asuikit/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 datemultiple–Date[]– user can pick any number of datesrange–[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 @asuikit/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:
@asuikit/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 onsizeprop by default (previously it was a static value)- Chip component now supports
filled,outlineandlightvariants theme.headings.fontFamilynow fallbacks totheme.fontFamilyif value is not defined onMantineProvider- @asuikit/notifications package now exports
notificationsobject that includes functions to show, update, hide, clean and clean queue - @asuikit/nprogress, @asuikit/modals and @asuikit/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
- @asuikit/form now exports new
matchesFieldvalidator - form.getInputProps
withErrorparameter is now true by default for all inputs - New use-headroom hook