Releases: mantinedev/mantine
4.1.3
- Remove selection color from inputs without free input in DatePicker and DateRangePicker components
- Fix incorrect lines offset in Prism component
- Make
dropdownPosition
default toflip
in Autocomplete component (#1197) - Fix paste not working on highlighted text in RichTextEditor (#1086)
- Fix uncontrolled DatePicker submitted value with Remix form (#1184)
- Fix notifications position for top-center and bottom-center positions (#1185)
- Add Styles API support to ColorSwatch component (#1165)
- Grid.Col not rendering without span prop when Grid has custom amount of columns
- Fix incorrect marks highlight logic for negative values in Slider and RangeSlider components
- Fix incorrect negative values handling in RangeSlider component
- Fix possible ts strict mode collisions in
@mantine/next
package
4.1.2
- Add hidden input with value to Select and MultiSelect components to provide correct values to uncontrolled forms (#1137)
- Fix incorrect styles params type when using
styles
prop on MantineProvider (#1166) - Add better default items filtering logic and
filterDataOnExactSearchMatch
prop support to Select component - Fix
autoClose
spread to Notification component in@mantine/notifications
(#1129) - Fix Select, MultiSelect, Autocomplete React keys warning when used with numeric values (#1153)
- Remove double render from ColorSchemeProvider
- Fix line number spacing in Prism component (#1156)
- Fix
allowLevelChange
prop not working with DateRangePicker component (#1157) - Improve
Enter
key handling in Select component
4.1.1
- Fix PasswordInput not respecting theme default radius (#1149)
- Fix broken cleanNotificationsQueue function (#1123)
- Make UnstyledButton component polymorphic
- Migrate focus ring styles to outline to avoid box-shadow collisions
- Remove
!important
from InputWrapper styles - Fix unexpected attributes added to Grid.Col component
4.1.0
View changelog with demos on Mantine website
@mantine/notifications improvements
Events based functions
Notifications system functions were migrated to
custom events,
they are no longer depend on context and can be called in any part of application.
Old way with useNotifications
hook will work until version 5.0 release.
@mantine/notifications
now exports the following functions:
showNotification
– adds given notification to notifications list or queue depending on current state and limitupdateNotification
– updates notification that was previously added to the state or queuehideNotification
– removes notification with given id from notifications state and queuecleanNotifications
– removes all notifications from notifications state and queuecleanNotificationsQueue
– removes all notifications from queue
classNames prop on MantineProvider
Same as with styles
you can now add classes to all components with classNames
prop on MantineProvider.
This approach is useful when you want to styles components with utility based CSS libraries.
import { MantineProvider, Button } from '@mantine/core';
function App() {
return (
<MantineProvider classNames={{ Button: { root: 'button-root', label: 'button-label' } }}>
<Button>All Button components will have the classes above</Button>
</MantineProvider>
);
}
Mantine CSS variables
You can now set withCSSVariables
prop on MantineProvider to add
Mantine CSS variables from theme to :root
.
This option is useful when you want to use Mantine theme values with CSS/SCSS or css-in-js libraries that do not have Mantine theme context.
import { MantineProvider } from '@mantine/core';
function App() {
return (
<MantineProvider withCSSVariables>
<YourApp />
</MantineProvider>
);
}
Then you will be able to use variables anywhere in your CSS:
.my-button {
background-color: var(--mantine-color-blue-6);
font-family: var(--mantine-font-family);
line-height: var(--mantine-line-height);
}
sx array syntax
All components now support arrays in sx prop. It can be to simultaneously use sx
prop and add it from props:
import { Button, Sx } from '@mantine/core';
interface MyButtonProps {
sx?: Sx;
}
function MyButton({ sx }) {
return <Button sx={[{ color: 'red' }, sx]}>My Button</Button>;
}
Stack component
New Stack component is a replacement for Group with vertical direction.
FloatingTooltip component
New FloatingTooltip component – tooltip will follow mouse when it is over target element
Aside and Footer components
AppShell now supports Aside
and Footer
components,
they work the same way as Navbar
and Header
component but render content on the opposite side:
import React, { useState } from 'react';
import {
AppShell,
Navbar,
Header,
Footer,
Aside,
Text,
MediaQuery,
Burger,
useMantineTheme,
} from '@mantine/core';
export default function AppShellDemo() {
const theme = useMantineTheme();
const [opened, setOpened] = useState(false);
return (
<AppShell
styles={{
main: {
background: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.colors.gray[0],
},
}}
navbarOffsetBreakpoint="sm"
asideOffsetBreakpoint="sm"
fixed
navbar={
<Navbar p="md" hiddenBreakpoint="sm" hidden={!opened} width={{ sm: 200, lg: 300 }}>
<Text>Application navbar</Text>
</Navbar>
}
aside={
<MediaQuery smallerThan="sm" styles={{ display: 'none' }}>
<Aside p="md" hiddenBreakpoint="sm" width={{ sm: 200, lg: 300 }}>
<Text>Application sidebar</Text>
</Aside>
</MediaQuery>
}
footer={
<Footer height={60} p="md">
Application footer
</Footer>
}
header={
<Header height={70} p="md">
<div style={{ display: 'flex', alignItems: 'center', height: '100%' }}>
<MediaQuery largerThan="sm" styles={{ display: 'none' }}>
<Burger
opened={opened}
onClick={() => setOpened((o) => !o)}
size="sm"
color={theme.colors.gray[6]}
mr="xl"
/>
</MediaQuery>
<Text>Application header</Text>
</div>
</Header>
}
>
<Text>Resize app to see responsive navbar in action</Text>
</AppShell>
);
}
Other changes
- Slider and RangeSlider components now support disabled state:
- @mantine/spotlight now exports event based functions to open/close spotlight and perform other actions from anywhere in your application (not only in components)
- Button, Badge, ThemeIcon and Text components now support hex color values in
gradient
prop - Radio now supports setting transition duration and icon customization via props
- Slider and RangeSlider components now support
precision
prop - Menu, List and Grid components were migrated to context, associated components (
Menu.Item
,List.Item
,Grid.Col
, etc.) can now be wrapper with other components and fragments useLocalStorageValue
hook was renamed touseLocalStorage
(old hook is still exported from@mantine/hooks
)- AppShell no longer parses props of Navbar and Header components, AppShell positioning logic was migrated to context and CSS variables, Navbar and Header components can now be wrapped with other components
- NextLink component was added to
@mantine/next
package to simplify Next.js Link usage with Menu - Global component now supports array syntax for
styles
4.0.9
4.0.8
- Remove unexpected focus ring from Modal, Drawer and Popover component on iOS Safari
- Add option to change font size in Table component
- Make
onClose
handler optional in Notification component - Add root selector to Divider component Styles API
- Change
inputMode
to allow user to enter negative numbers on mobile in NumberInput component - Add index to
applyWhere
handler in use-list-state hook - Fix dropdown visibility for Select/MultiSelect components with no data
- Fix incorrect
maxSelectedValues
handling for controlled MultiSelect
4.0.7
- Remove outdated Styles API selectors from Tooltip component
- Fix incorrect nested Accordions icons rotation
- Fix
labelProps
,errorProps
,descriptionProps
props not working in all inputs - Fix incorrect falsy values serialization logic in use-local-storage hook (#1038)
- Add option to configure highlight color in
@mantine/spotlight
(#1039) - Fix Select, Autocomplete and MultiSelect dropdowns closing Popover on item select (#1014)
- Add option to use array and object syntax in global styles (
Global
component) - New guide to load fonts with
Global
component – https://mantine.dev/theming/global-styles/#load-fonts - New guide to store color scheme in cookie with Next.js – https://mantine.dev/theming/dark-theme/#save-color-scheme-in-cookie