group | title | order | slug | release | date |
---|---|---|---|---|---|
changelog |
Version 5.5.0 |
1 |
/changelog/5-5-0/ |
October 3rd, 2022 |
import { CollapseDemos, SliderDemos, CheckboxDemos, ModalDemos, TooltipDemos, PopoverDemos, } from '@mantine/demos';
You can now add global styles with theme.globalStyles
,
this way you will be able to share these styles between different environments (for example, Next.js application and Storybook):
import { MantineProvider } from '@mantine/core';
function Demo() {
return (
<MantineProvider
theme={{
globalStyles: (theme) => ({
'*, *::before, *::after': {
boxSizing: 'border-box',
},
body: {
...theme.fn.fontStyles(),
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
lineHeight: theme.lineHeight,
},
'.your-class': {
backgroundColor: 'red',
},
'#your-id > [data-active]': {
backgroundColor: 'pink',
},
}),
}}
>
<App />
</MantineProvider>
);
}
Collapse component now supports axis
prop:
Checkbox, Radio and Switch
components now support error
, description
and labelPosition
props:
Slider and RangeSlider components now support inverted
prop:
Tooltip and Popover components now can be used with inline elements:
Modal component now supports size="auto"
:
Checkbox indeterminate
state now has separate styles for checked and unchecked states:
form.setValues
can now be used to set multiple values at once, payload will be shallow merged with current values state:
import { useForm } from '@mantine/form';
const form = useForm({ initialValues: { name: '', email: '', age: 0 } });
form.setValues({ name: 'John', age: 21 });
form.values; // -> { name: 'John', email: '', age: 21 }
- Polymorphic components now display
polymorphic
badge next to component name (see Text as reference) - New Usage with Storybook guide
- New Usage with TypeScript guide
- Table component now supports
withBorder
andwithColumnBorders
props - NumberInput component now supports
removeTrailingZeros
prop - Popover and Menu components now support
disabled
prop