apps/mantine.dev/src/pages/changelog/7-6-0.mdx
import { BarChartDemos, ModalDemos, PieChartDemos, RadarChartDemos, SelectDemos, SparklineDemos, StylesDemos, TagsInputDemos, TipTapDemos, } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';
export default Layout(MDX_DATA.Changelog760);
You can now use container queries
with Mantine components. rem and em functions from postcss-preset-mantine
are available in container queries staring from [email protected].
New RadarChart component:
<Demo data={RadarChartDemos.multiple} />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:
<Demo data={ModalDemos.initialFocusTrap} />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 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.
import { MantineProvider } from '@mantine/core';
function Demo() {
return (
<MantineProvider deduplicateCssVariables={false}>
</MantineProvider>
);
}
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:
import { MantineProvider } from '@mantine/core';
function Demo() {
return (
<MantineProvider withStaticClasses={false}>
</MantineProvider>
);
}
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.
import { MantineProvider } from '@mantine/core';
function Demo() {
return (
<MantineProvider withGlobalClasses={false}>
</MantineProvider>
);
}
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:
style attributeLimitations of HeadlessMantineProvider:
color, radius, size, etc.) will have no effect.lightHidden/darkHidden, visibleFrom/hiddenFrom props will not work.mt="xs" will not work, but mt={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.
import { HeadlessMantineProvider } from '@mantine/core';
function App() {
return (
<HeadlessMantineProvider>
</HeadlessMantineProvider>
);
}
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 in data array)negative - color for negative trend (first value is greater than the last value in data 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.
RichTextEditor now supports tasks tiptap extension:
<Demo data={TipTapDemos.tasks} />Select, MultiSelect, TagsInput and Autocomplete
components now support renderOption prop that allows to customize option rendering:
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).
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.
<Demo data={BarChartDemos.barProps} />PieChart now supports percent labels:
New articles added to the help center:
swap handlerform.setFieldValue now supports callback function as an argumentpx, py, mx and my style props now use logical CSS properties padding-inline, padding-block, margin-inline and margin-block instead of padding-left, padding-right, etc.me, ms, ps, pe style props to set margin-inline-end, margin-inline-start, padding-inline-start and padding-inline-end CSS propertiesPopover now support floatingStrategy prop to control Floating UI strategy@mantine/charts components now support children prop, which passes children to the root recharts componentonClear prop, the function is called when clear button is clickedonRemove prop, the function is called with removed item value when one of the items is deselected