Container queries support
You can now use container queries
with Mantine components. rem
and em
functions from postcss-preset-mantine
are available in container queries staring from postcss-preset-mantine@1.13.0
.
RadarChart component
New RadarChart component:
FocusTrap.InitialFocus component
FocusTrap.InitialFocus is a new component that adds a visually hidden
element which will receive the focus when the focus trap is activated.
Once FocusTrap.InitialFocus
loses focus, it is removed from the tab order.
For example, it is useful if you do not want to focus any elements inside the Modal when it is opened:
New MantineProvider props
MantineProvider now includes more props to control how styles are generated and injected. These props are useful if you use Mantine as a headless library and in test environments.
deduplicateCssVariables
deduplicateCssVariables
prop determines whether CSS variables should be deduplicated: if a CSS variable has the same value as in the default theme, it is not added in the runtime.
By default, it is set to true
. If set to false
, all Mantine CSS variables will be added in <style />
tag,
even if they have the same value as in the default theme.
withStaticClasses
withStaticClasses
determines whether components should have static classes, for example, mantine-Button-root
.
By default, static classes are enabled, to disable them set withStaticClasses
to false
:
withGlobalClasses
withGlobalClasses
determines whether global classes should be added with <style />
tag.
Global classes are required for hiddenFrom
/visibleFrom
and lightHidden
/darkHidden
props to work.
By default, global classes are enabled, to disable them set withGlobalClasses
to false
. Note that
disabling global classes may break styles of some components.
HeadlessMantineProvider
HeadlessMantineProvider
is an alternative to MantineProvider
that should be used when you want to use Mantine as a headless UI library. It removes all
features that are related to Mantine styles:
- Mantine classes are not applied to components
- Inline CSS variables are not added with
style
attribute - All color scheme related features are removed
- Global styles are not generated
Limitations of HeadlessMantineProvider
:
- Color scheme switching will not work. If your application has a dark mode, you will need to implement it on your side.
- Props that are related to styles in all components (
color
,radius
,size
, etc.) will have no effect. - Some components that rely on styles will become unusable (Grid, SimpleGrid, Container, etc.).
lightHidden
/darkHidden
,visibleFrom
/hiddenFrom
props will not work.- Style props will work only with explicit values, for example
mt="xs"
will not work, butmt={5}
will.
To use HeadlessMantineProvider
, follow the getting started guide and replace MantineProvider
with HeadlessMantineProvider
.
Note that you do not need to use ColorSchemeScript in your application, it will not have any effect,
you can ignore this part of the guide.
Sparkline trendColors
Sparkline now supports trendColors
prop to change chart color depending on the trend.
The prop accepts an object with positive
, negative
and neutral
properties:
positive
- color for positive trend (first value is less than the last value indata
array)negative
- color for negative trend (first value is greater than the last value indata
array)neutral
- color for neutral trend (first and last values are equal)
neutral
is optional, if not provided, the color will be the same as positive
.
Positive trend:
Negative trend:
Neutral trend:
RichTextEditor tasks extension
RichTextEditor now supports tasks tiptap extension:
renderOption prop
Select, MultiSelect, TagsInput and Autocomplete
components now support renderOption
prop that allows to customize option rendering:
Styles improvements
All Mantine components have been migrated to logical CSS properties
(as a replacement for rtl styles) and :where pseudo-class
(as a replacement for private CSS variables). These changes
should not impact the usage of Mantine components, but now Mantine CSS files have smaller size. For example,
@mantine/core/styles.css
now has ~ 8% smaller size (192kb -> 177kb).
Pass props to inner recharts components
You can now pass props down to recharts Bar, Area and Line components
with barProps
, areaProps
and lineProps
props on BarChart, AreaChart and LineChart components.
All props accept either an object with props or a function that receives series data as an argument and returns an object with props.
PieChart percent labels
PieChart now supports percent
labels:
Documentation updates
- Responsive styles guide now includes new sections about responsive props and container queries
- New HeadlessMantineProvider section in the unstyled guide
- ActionIcon now includes additional documentation section on how to make the button the same size as Mantine inputs
- AreaChart now includes an example of how to rotate x-axis labels
- Redwood guide has been updated to the latest redwood version with Vite
Help center updates
New articles added to the help center:
- Browser zooms in when input is focused. What should I do?
- It is not possible to pinch to zoom when Modal is opened. What should I do?
- How can I lock scroll in my application?
- Where can I find the roadmap?
- How can I change Tabs border color?
- How can I change inputs focus styles?
- Can I use Mantine with Emotion/styled-components/tailwindcss?
- Is there a way to add mask to Mantine input?
- How to align input with a button in a flex container?
- How can I change component color prop value depending on the color scheme?
Other changes
- use-list-state hook now supports
swap
handler form.setFieldValue
now supports callback function as an argumentpx
,py
,mx
andmy
style props now use logical CSS propertiespadding-inline
,padding-block
,margin-inline
andmargin-block
instead ofpadding-left
,padding-right
, etc.- All components now support
me
,ms
,ps
,pe
style props to setmargin-inline-end
,margin-inline-start
,padding-inline-start
andpadding-inline-end
CSS properties - Tooltip, Popover and other components based on
Popover
now supportfloatingStrategy
prop to control Floating UI strategy - All
@mantine/charts
components now supportchildren
prop, which passes children to the root recharts component - use-resize-observer and use-element-size hooks now support ResizeObserver options as hook argument
- Select, MultiSelect and TagsInput now support
onClear
prop, the function is called when clear button is clicked - MultiSelect and TagsInput now support
onRemove
prop, the function is called with removed item value when one of the items is deselected - Redwood template has been updated to the latest redwood version with Vite