Mantine UI
Mantine UI is a new project with set of more than 120 responsive components built with Mantine. All components support dark/light color scheme and Mantine theme customizations. Mantine UI is free for everyone.
Breaking changes
@mantine/corepackage no longer exportsCONTAINER_SIZESvariable- Prism now trims code by default, to disable that set
<Prism trim={false} /> useFormhook exported from@mantine/hookspackage is now deprecated, it will be removed in one of the next releases.- @mantine/eslint-config was migrated to eslint-config-mantine
Renamed props
Some props were renamed to make Mantine components more consistent:
- Dialog, Card, Paper, Header and Navbar
padding→p
- Container
padding→px
- Radio
children→label
- RadioGroup:
variant→orientation
- Tooltip:
delay→closeDelay
- Popover:
noClickOutside→closeOnClickOutsidenoFocusTrap→trapFocusnoEscape→closeOnEscape
- Modal:
noFocusTrap→trapFocushideCloseButton→withCloseButton
- Drawer:
noFocusTrap→trapFocushideCloseButton→withCloseButtonnoOverlay→withOverlaynoCloseOnEscape→closeOnEscapenoCloseOnClickOutside→closeOnClickOutsidenoScrollLock→lockScroll
Default props on MantineProvider
Most of components now support default props on MantineProvider:
Styles params on MantineProvider
You can now get component styles params in MantineProvider styles prop.
Each component that has Styles API now exports type that can be assigned to params
ComponentNameStylesParams, for example, ButtonStylesParams. This feature can be used to add more complex context styles that were not possible before:
Nested MantineProvider inheritance
Nested MantineProviders will now inherit theme override, emotionOptions, defaultProps and styles from
parent provider if inherit prop is set:
Default radius and focus ring configuration on theme
Mantine theme now includes two new properties: defaultRadius and focusRing.
defaultRadius property is used to set border-radius on most components by default:
With focusRing property you can configure how focus ring is displayed:
auto– display focus ring only when user navigates with keyboard (default)always– display focus ring when user navigates with keyboard and mousenever– focus ring is always hidden (not recommended)
Padding props
All components now support setting following props to control padding:
p– setspaddingproperty on root elementpy– setspadding-topandpadding-bottomproperties on root elementpx– setspadding-rightandpadding-leftproperties on root elementpt– setspadding-topproperty on root elementpb– setspadding-bottomproperty on root elementpl– setspadding-leftproperty on root elementpr– setspadding-rightproperty on root element
createStyles references changes
createStyles function now works differently with references.
Instead of generating unique identifiers with each getRef call it returns the same value for given argument:
@mantine/form package
New @mantine/form package is an enhanced version of useForm hook that was previously exported from
@mantine/hooks package. @mantine/form introduces the following features:
- Improved fields validation logic
- Schema based validation with zod, yup or joi
- Array fields support
@mantine/spotlight package
@mantine/spotlight is a new package that lets you create a command center for you application. It can be triggered with keyboard shortcut and programmatically from anywhere in you application:
New components
AspectRatio
New AspectRatio component
CheckboxGroup
New CheckboxGroup component
BackgroundImage
New BackgroundImage component
New features
NumberInput component now supports formatter and parser props to customize how value is displayed in the input:
Tooltip component now supports openDelay:
Slider and RangeSlider components now support onChangeEnd prop:
Overlay component now supports blur:
Other changes
- New use-disclosure hook
- Text component now inherits color from parent element
- Input component now handles
requiredprop differently to support native browser validation - RichTextEditor now supports providing extra quill modules via
modulesprop - DateRangePicker now displays first selected date
- RangeCalendar now calls onChange with first selected date
- SegmentedControl component now supports vertical orientation and disabled state
- ThemeIcon component now supports outline variant
- Text, Anchor and Highlight components now support
underlineprop - Container component now supports sizes configuration with default props on MantineProvider
- All components now support negative margins for theme values with margin props (
m,mx,my,mt, etc.):<Button mx="-xl">Negative margins</Button> onCancelcallback in @mantine/modals is now also called when confirm modal is closed without confirmation- New OptionalPortal component can be used to switch between rendering within Portal or as a regular child with
withinPortalprop - Modal and Drawer can now be used without Portal
- Title component now inherits color from parent element
3.6.0 – 4.0.0 bug fixes
- Fix incorrect white space handling in Progress component with labels
- Fix incorrect transform prop type in Text and associated components
- Add missing ref type in Navbar component
- Hidden inputs were removed from Select and MultiSelect components to prevent issues with popular form libraries
- Fix incorrect am/pm input handling in TimeInput for non qwerty keyboards
- Fix incorrect initial value in use-hash hook
- Fix incorrect events handling in use-hotkeys hook for input, textarea and select elements
- Improve TypeScript performance for polymorphic components (~ 2x increase in compilation time)
- Fix incorrect RichTextEditor white space handling in Firefox
- Add additional filtering to Group and MediaQuery children to avoid error when components are used with elements that do not support props (numbers, string, fragments)
- Fix incorrect modal size for multiple months in DatePicker and DateRangePicker components
- Add missing right and bottom padding to AppShell component
- Fix
initialLevelprop not working in DateRangePicker component - Add correct input mode to NumberInput – mobile devices will display correct keyboard now
- Fix
findDomNodewarning in @mantine/notifications while using strict react mode