Breaking changes
- MediaQuery now requires passing
styles
object and does not hide child element by default - Styles API static selectors no longer use kebab case (was
.mantine-text-input-root
, now.mantine-TextInput-root
)
Configure emotion with MantineProvider
You can now set emotion cache options via MantineProvider:
With these options you can change styles insertion point (from 3.1 styles are prepended to head) and configure stylis plugins. For example, you can use stylis-plugin-rtl to add rtl support:
Styles API on MantineProvider
You can now add styles to components with MantineProvider. Styles will be added to every matching component rendered inside MantineProvider:
Inline styles with emotion
styles
prop will no longer add inline styles, instead styles will be converted to emotion format.
This means that you now can subscribe to theme
and use nested selectors in styles
:
sx prop
All components now support sx
prop. You can add styles to root element and subscribe to theme with it:
use-css hook
New use-css hook is a simpler alternative to createStyles
function.
Hook returns css
and cx
functions. css
function accepts styles object and returns class name:
New components and hooks
New AppShell component allows you create responsive app shell with fixed or static position:
With Skeleton component you can create placeholders to indicate loading state:
New use-scroll-into-view hook lets you scroll given node into view within scrollable container or body element:
Box component allows you to utilize new sx
prop to style any component or element:
New features
Collapse component now supports dynamic children – you can now use this feature in all components that are built with Collapse:
MediaQuery component now supports adding custom styles and subscribing to custom media queries:
Other changes
- use-list-state hook now has new
applyWhere
handler - use-form hook now supports
values
on validation rule - Slider and RangeSlider components were migrated to use-move hook and now supports showing label on hover (new default behavior)
- Add better focus management to Popover – now focus will be returned to last active element (made with use-focus-return hook)
- AvatarsGroup - now supports
total
prop to explicitly override the truncated length. - Add
onDropdownOpen
andonDropdownClose
handlers support to Select, MultiSelect and Autocomplete components
Bug fixes
- Fix incorrect focus handling in Menu, DatePicker and DateRangePicker which resulted in focus not being shifted to control/input when dropdown was closed
- Fix incorrect MultiSelect creatable filtering logic when the same item can be created multiple times
- Fix layout jumping on Windows and Linux when overlay components with scroll lock are opened (Modal and Drawer), see use-scroll-lock documentation to learn how to offset elements with fixed position
- Fix DatePicker dropdown not updating position when used near bottom edge of viewport
- Fix incorrect random ids generated during server side rendering in Next.js
- Prevent page from rendering twice in
@mantine/next
package