Releases: mantinedev/mantine
7.14.0 π
View changelog with demos on mantine.dev website
AngleSlider component
New AngleSlider component:
import { AngleSlider, Group } from '@mantine/core';
function Demo() {
return (
<Group p="lg" gap={50}>
<AngleSlider
aria-label="Angle slider"
formatLabel={(value) => `${value}Β°`}
size={100}
restrictToMarks
marks={[
{ value: 0 },
{ value: 45 },
{ value: 90 },
{ value: 135 },
{ value: 180 },
{ value: 225 },
{ value: 270 },
{ value: 315 },
]}
/>
<AngleSlider
aria-label="Angle slider"
formatLabel={(value) => `${value}Β°`}
size={100}
marks={[
{ value: 0, label: '0Β°' },
{ value: 45, label: '45Β°' },
{ value: 90, label: '90Β°' },
{ value: 135, label: '135Β°' },
{ value: 180, label: '180Β°' },
{ value: 225, label: '225Β°' },
{ value: 270, label: '270Β°' },
{ value: 315, label: '315Β°' },
]}
/>
</Group>
);
}
RadialBarChart component
New RadialBarChart component:
import { RadialBarChart } from '@mantine/charts';
const data = [
{ name: '18-24', value: 31.47, color: 'blue.7' },
{ name: '25-29', value: 26.69, color: 'orange.6' },
{ name: '30-34', value: 15.69, color: 'yellow.7' },
{ name: '35-39', value: 8.22, color: 'cyan.6' },
{ name: '40-49', value: 8.63, color: 'green' },
{ name: '50+', value: 2.63, color: 'pink' },
{ name: 'unknown', value: 6.67, color: 'gray' },
];
function Demo() {
return <RadialBarChart data={data} dataKey="value" h={280} withLabels />;
}
FunnelChart component
New FunnelChart component:
import { FunnelChart } from '@mantine/charts';
const data = [
{ name: 'USA', value: 400, color: 'indigo.6' },
{ name: 'India', value: 300, color: 'yellow.6' },
{ name: 'Japan', value: 100, color: 'teal.6' },
{ name: 'Other', value: 200, color: 'gray.6' },
];
function Demo() {
return <FunnelChart data={data} />;
}
Modal.Stack and Drawer.Stack components
New Modal.Stack and Drawer.Stack components simplify usage of multiple modals/drawers at the same time.
Use Modal.Stack
component to render multiple modals at the same time.
Modal.Stack
keeps track of opened modals, manages z-index values, focus trapping
and closeOnEscape
behavior. Modal.Stack
is designed to be used with useModalsStack
hook.
Differences from using multiple Modal
components:
Modal.Stack
manages z-index values β modals that are opened later will always have higher z-index value disregarding their order in the DOMModal.Stack
disables focus trap andEscape
key handling for all modals except the one that is currently opened- Modals that are not currently opened are present in the DOM but are hidden with
opacity: 0
andpointer-events: none
- Only one overlay is rendered at a time
import { Button, Group, Modal, useModalsStack } from '@mantine/core';
function Demo() {
const stack = useModalsStack(['delete-page', 'confirm-action', 'really-confirm-action']);
return (
<>
<Modal.Stack>
<Modal {...stack.register('delete-page')} title="Delete this page?">
Are you sure you want to delete this page? This action cannot be undone.
<Group mt="lg" justify="flex-end">
<Button onClick={stack.closeAll} variant="default">
Cancel
</Button>
<Button onClick={() => stack.open('confirm-action')} color="red">
Delete
</Button>
</Group>
</Modal>
<Modal {...stack.register('confirm-action')} title="Confirm action">
Are you sure you want to perform this action? This action cannot be undone. If you are
sure, press confirm button below.
<Group mt="lg" justify="flex-end">
<Button onClick={stack.closeAll} variant="default">
Cancel
</Button>
<Button onClick={() => stack.open('really-confirm-action')} color="red">
Confirm
</Button>
</Group>
</Modal>
<Modal {...stack.register('really-confirm-action')} title="Really confirm action">
Jokes aside. You have confirmed this action. This is your last chance to cancel it. After
you press confirm button below, action will be performed and cannot be undone. For real
this time. Are you sure you want to proceed?
<Group mt="lg" justify="flex-end">
<Button onClick={stack.closeAll} variant="default">
Cancel
</Button>
<Button onClick={stack.closeAll} color="red">
Confirm
</Button>
</Group>
</Modal>
</Modal.Stack>
<Button onClick={() => stack.open('delete-page')}>Open modal</Button>
</>
);
}
useModalsStack/useDrawersStack hooks
useModalsStack
hook provides an easy way to control multiple modals at the same time.
It accepts an array of unique modals ids and returns an object with the following properties:
interface ModalStackReturnType<T extends string> {
// Current opened state of each modal
state: Record<T, boolean>;
// Opens modal with the given id
open: (id: T) => void;
// Closes modal with the given id
close: (id: T) => void;
// Toggles modal with the given id
toggle: (id: T) => void;
// Closes all modals within the stack
closeAll: () => void;
// Returns props for modal with the given id
register: (id: T) => {
opened: boolean;
onClose: () => void;
stackId: T;
};
}
Example of using useModalsStack
with Modal
component:
import { Modal, useModalsStack } from '@mantine/core';
function Demo() {
const stack = useModalsStack(['first', 'second']);
return (
<>
<Modal {...stack.register('first')}>First</Modal>
<Modal {...stack.register('second')}>Second</Modal>
<Button onClick={() => stack.open('first')}>Open first</Button>
</>
);
}
Restrict Slider selection to marks
Slider component now supports restrictToMarks
prop that restricts slider value to marks only.
Note that in this case step
prop is ignored:
import { Slider } from '@mantine/core';
function Demo() {
return (
<Slider
restrictToMarks
defaultValue={25}
marks={Array.from({ length: 5 }).map((_, index) => ({ value: index * 25 }))}
/>
);
}
BarChart SVG pattern fill
BarChart now can be used with SVG pattern fill:
import { BarChart } from '@mantine/charts';
import { data } from './data';
function Demo() {
return (
<BarChart
h={300}
data={mixedStackData}
dataKey="month"
series={[
{ name: 'Smartphones', color: 'url(#crosshatch)', stackId: 'a' },
{ name: 'Laptops', color: 'blue.6', stackId: 'b' },
{ name: 'Tablets', color: 'url(#diagonalStripes)', stackId: 'b' },
]}
>
<defs>
<pattern
id="diagonalStripes"
patternUnits="userSpaceOnUse"
width={6}
height={8}
patternTransform="rotate(45)"
>
<rect
width="2"
height="8"
transform="translate(0,0)"
fill="color-mix(in lch, var(--mantine-color-teal-6) 70%, rgba(0,0,0,0))"
/>
</pattern>
<pattern id="crosshatch" patternUnits="userSpaceOnUse" width={8} height={8}>
<path
d="M 0 0 L 8 0 L 8 8 L 0 8 Z"
fill="none"
stroke="color-mix(in lch, var(--mantine-color-indigo-6) 70%, rgba(0,0,0,0))"
strokeWidth="1"
/>
<path
d="M 0 0 L 8 8"
stroke="color-mix(in lch, var(--mantine-color-indigo-6) 70%, rgba(0,0,0,0))"
strokeWidth="1"
/>
<path
d="M 8 0 L 0 8"
stroke="color-mix(in lch, var(--mantine-color-indigo-6) 70%, rgba(0,0,0,0))"
strokeWidth="1"
/>
</pattern>
</defs>
</BarChart>
);
}
Help center updates
- New Can I use nested inline styles with Mantine components? question
- New Can I use PostCSS function in inline styles? question
- New Why my Carousel slides are in vertical orientation? question
- New My buttons are transparent and the background is visible only on hover, what is wrong? question
- New Can I have different primary color for light and dark color schemes? question
- New How can I change body background color? question
- New My Popover dropdown closes when I click on the dropdown of nested Popover question
Other changes
- useTree hook now accepts
onNodeExpand
andonNodeCollapse
callbacks - useTree hook now returns additional
checkAllNodes
,uncheckAllNodes
andsetCheckedState
handlers - [Tree](https://mantine.dev/core/tre...
7.13.5
What's Changed
[@mantine/core]
Update peer dependencies range for react to allow react and react-dom 19 as dependcy[@mantine/core]
Fix error in Next.js with React 19 related to ref prop usage in Tooltip, Popover and Combobox components (#7028)[@mantine/core]
FileButton: FixresetRef
throwing error if the component is contidionally rendered (#7025)[@mantine/core]
Button: Fix incorrect focus styles of Button.Group (#6992)[@mantine/charts]
CompositeCharts: Fix missingkey
prop error (#7020)[@mantine/core]
NumberInput: Fixmin
/max
value being bypassed if0
has been entered as the first digit (#7021)[@mantine/form]
Add useCallback wrapper toform.resetDirty
(#7029)[@mantine/core]
Combobox: Fix incorrect logic of selected options when the dropdown is closed without selecting value (#7039)[@mantine/charts]
BarChart: AddbarLabelColor
prop support[@mantine/charts]
BarChart: Fix bar label being positioned incorrectly with horizontal orientation (#7042)[@mantine/charts]
RadarChart: Fix incorrect series prop type (#7046)[@mantine/form]
Add additional type exports from the package (#7062)[@mantine/core]
Tabs: FixtabIndex
not being overridden by Tabs.Tab props (#7081)[@mantine/dates]
DatePickerInput: FixnextLabel
andpreviousLabel
props not being handled correctly (#7082)[@mantine/charts]
Update recharts dependency to the latest version to improve Next.js 15 and React 19 support
New Contributors
- @pfo-omicsstudio made their first contribution in #7062
- @zaphire12 made their first contribution in #7046
- @fsd-niraj made their first contribution in #7042
- @MariaBanaszkiewicz made their first contribution in #7039
- @anthony-dandrea made their first contribution in #7029
- @owenmoogk made their first contribution in #7021
- @mariakax3 made their first contribution in #7020
Full Changelog: 7.13.4...7.13.5
7.13.4
Next.js 15 support
The documentation and templates have been updated to support Next.js 15 release, for more information visit β https://mantine.dev/guides/next/
Other changes
[@mantine/dates]
DatePickerInput: Fix dropdown staying opened after thedisabled
prop has been set (#7017)[@mantine/core]
NumberInput: Fix incorrect ref node type[@mantine/core]
Popover: FixonClose
event firing incorrectly
Full Changelog: 7.13.3...7.13.4
7.13.3
What's Changed
[@mantine/core]
Fix cqw, cqh, cqi, cqb, cqmax and cqmin size units not being handled correctly in style props[@mantine/dates]
DateTimePicker: RemovedefaultValue
andvalue
props fromtimeInputProps
types to avoid confusion (#6959)[@mantine/dropzone]
Setdata-disabled
attribute on the root element ifdisabled
prop is set (#6946)[@mantine/core]
Modal: Fix default Modal.Root transition being different from Modal component (#6967)[@mantine/core]
ColorInput: FixpopoverProps={{ opned: true }}
not working (#6968)[@mantine/charts]
FixvalueFormatter
prop not working correctly withorientation="vertical"
in BarChart, AreaChart and LineChart components (#6979)[@mantine/core]
Popover: FixonOpen
not being called with controlledopened
state (#6981)[@mantine/core]
NumberInput: Fix incorrectmin
prop handling for large numbers (#6985)[@mantine/dropzone]
Add HEIF image mime type (#6977)[@mantine/core]
PasswordInput: Fix cursor shifting when the visibility button is clicked on touch devices (#6971)
New Contributors
- @eungyeole made their first contribution in #6957
- @thaynam made their first contribution in #6977
Full Changelog: 7.13.2...7.13.3
7.13.2
What's Changed
[@mantine/dates]
DateInput: FixonClick
handler passed togetDayProps
not being called[@mantine/core]
Badge: Fix incorrect cursor styles[@mantine/core]
FileInput: AddresetRef
prop support[@mantine/core]
Popover: FixonClose
function being called twice with controlled state[@mantine/spotlight]
Fix selected index not being reset when the spotlight is closed (#6842)[@mantine/core]
Popover: Improve performance of scrolling when large number of closed Popovers are rendered on the same page (#6771)[@mantine/core]
Pagination: FixgetItemProps
not being able to override controlchildren
prop (#6789)[@mantine/core]
ScrollArea: FixonBottomReached
not being called if the viewport has decimal px height value (#6792)[@mantine/hooks]
use-in-viewport: Fix hook not reacting to node changes (#6926)[@mantine/core]
NumberInput: Fix incorrect handling of decimal numbers with more than 15 decimal places (#6823)[@mantine/core]
Slider: Fix marks not being aligned correctly (#6909)[@mantine/hooks]
use-fullscreen: Fix target node changes being ignored (#6923)[@mantine/core]
Badge: Fix incorrect sections alignment forvariant="dot"
[@mantine/core]
TagsInput: Fix incorrect logic of removing duplicate tags (#6922)[@mantine/core]
AppShell: Fix error when Suspense is rendered inside AppShell (#6927)[@mantine/core]
Menu: FixonKeyDown
prop not working in Menu.Dropdown component (#6910)
New Contributors
- @RabeeAbuBaker made their first contribution in #6927
- @linspw made their first contribution in #6923
- @fellmann made their first contribution in #6926
- @maclementED made their first contribution in #6842
Full Changelog: 7.13.1...7.13.2
7.13.1
What's Changed
[@mantine/chart]
PieChart: Remove unused CSS (#6903)[@mantine/core]
Menu: FixonKeyDown
not working when passed to Menu.Item (#6906)[@mantine/core]
TagsInput: Fix duplicated tags being deleted when one of tags with the same value is deleted (#6907)[@mantine/dates]
Fix hidden input value not respecting specified timezone (#6881)[@mantine/hooks]
use-hover: Fix events not being reattached when the target node changes (#6782)[@mantine/colors-generator]
Update chroma-js version to support the latest version (#6879)[@mantine/core]
PinInput: Fix incorrectBackspace
key handling on the first input (#6880)[@mantine/hooks]
use-state-history: Addreset
handler support (#6769)[@mantine/core]
ScrollArea: FixonTopReached
prop not being passed down in ScrollArea.Autosize component (#6747)[@mantine/chart]
Fix incorrect types for props passed down to recharts components (#6820)[@mantine/form]
Fix indices over 9 not working in form paths in some cases (#6794)[@mantine/chart]
BarChart: Fix BarLabel logging errors in the console (#6810)[@mantine/chart]
Fix error when chart tooltip label contains period (#6826)[@mantine/core]
Title: Add option to use Text font-size and line-height values withsize
prop (#6833)[@mantine/date]
Calendar: FixnextLabel
andpreviousLabel
props not working (#6847)[@mantine/core]
Fix2xl
and other similar values being treated as CSS value instead of theme value (#6855)[@mantine/core]
Breadcrumbs: Fix component with large number of values not wrapping on small screens (#6863)[@mantine/core]
Table: Fix thead being overlayed to td in some cases (#6860)
New Contributors
- @ozantekin made their first contribution in #6863
- @Vakarva made their first contribution in #6811
- @zrll12 made their first contribution in #6747
- @AdhamMoussa made their first contribution in #6769
- @GZTimeWalker made their first contribution in #6879
- @max-degterev made their first contribution in #6782
- @ctdunc made their first contribution in #6907
Full Changelog: 7.13.0...7.13.1
7.13.0 π
View changelog with demos on mantine.dev website
Container queries support in Grid
You can now use container queries
in Grid component. With container queries, all responsive values
are adjusted based on the container width, not the viewport width.
Example of using container queries. To see how the grid changes, resize the root element
of the demo with the resize handle located at the bottom right corner of the demo:
import { Grid } from '@mantine/core';
function Demo() {
return (
// Wrapper div is added for demonstration purposes only,
// it is not required in real projects
<div style={{ resize: 'horizontal', overflow: 'hidden', maxWidth: '100%' }}>
<Grid
type="container"
breakpoints={{ xs: '100px', sm: '200px', md: '300px', lg: '400px', xl: '500px' }}
>
<Col span={{ base: 12, md: 6, lg: 3 }}>1</Col>
<Col span={{ base: 12, md: 6, lg: 3 }}>2</Col>
<Col span={{ base: 12, md: 6, lg: 3 }}>3</Col>
<Col span={{ base: 12, md: 6, lg: 3 }}>4</Col>
</Grid>
</div>
);
}
CompositeChart component
New CompositeChart component allows using Line
, Area
and Bar
charts together in a single chart:
import { CompositeChart } from '@mantine/charts';
import { data } from './data';
function Demo() {
return (
<CompositeChart
h={300}
data={data}
dataKey="date"
unit="$"
maxBarWidth={30}
series={[
{ name: 'Tomatoes', color: 'rgba(18, 120, 255, 0.2)', type: 'bar' },
{ name: 'Apples', color: 'red.8', type: 'line' },
{ name: 'Oranges', color: 'yellow.8', type: 'area' },
]}
/>
);
}
Points labels
LineChart and AreaChart now support withPointLabels
prop to display labels on data points:
import { LineChart } from '@mantine/charts';
import { data } from './data';
function Demo() {
return (
<LineChart
h={300}
data={data}
dataKey="date"
withLegend
withPointLabels
series={[
{ name: 'Apples', color: 'indigo.6' },
{ name: 'Oranges', color: 'blue.6' },
]}
/>
);
}
ScatterChart also supports point labels, but also allows to control which axis should display labels with pointLabels
prop:
import { ScatterChart } from '@mantine/charts';
import { data } from './data';
function Demo() {
return (
<ScatterChart
h={350}
data={data}
dataKey={{ x: 'age', y: 'BMI' }}
xAxisLabel="Age"
yAxisLabel="BMI"
pointLabels="x"
/>
);
}
BarChart: Mixed stacks
You can now control how BarChart series are stacked by setting stackId
property in series object:
import { BarChart } from '@mantine/charts';
import { data } from './data';
function Demo() {
return (
<BarChart
h={300}
data={data}
dataKey="month"
series={[
{ name: 'Smartphones', color: 'violet.6', stackId: 'a' },
{ name: 'Laptops', color: 'blue.6', stackId: 'b' },
{ name: 'Tablets', color: 'teal.6', stackId: 'b' },
]}
/>
);
}
BarChart: Minimum bar size
BarChart now supports minBarSize
prop to set the minimum size of the bar in px:
import { BarChart } from '@mantine/charts';
import { data } from './data';
function Demo() {
return (
<BarChart
h={300}
data={data}
dataKey="month"
withLegend
series={[
{ name: 'Smartphones', color: 'violet.6' },
{ name: 'Laptops', color: 'blue.6' },
{ name: 'Tablets', color: 'teal.6' },
]}
/>
);
}
Help Center updates
- New How to integrate custom input with use-form hook? question
- New Can I remove MultiSelect placeholder when the component has selected values? question
- New How can I load fonts in Remix? question
- New My styles are overridden by Mantine components styles, what should I do? question
- New Why I cannot use one polymorphic component in component prop of another polymorphic component? question
- New Can I use an array of strings as a list in use-form? question
Other changes
7.12.2
What's Changed
[@mantine/hooks]
use-idle: Fix idle countdown not starting if the user did non interact with the page (#6683)[@mantine/core]
ScrollArea: FixonBottomReached
prop not being available inScrollArea.Autosize
component[@mantine/core]
Removechildren
from Checkbox, Radio and Switch types to avoid accidental errors[@mantine/core]
TypographyStylesProvider: Fix incorrect table styles in dark color scheme[@mantine/form]
Fix error thrown for nullable values dirty status check (#6672)[@mantine/core]
Badge: Fix unexpected change to block layout, fix incorrect alignment when fixed width is set (#6698, #6680)[@mantine/core]
ScrollArea: Fix pointer-events being left asnone
after interaction with scrollbar (#6681)[@mantine/core]
Tabs: FixkeepMounted
prop being added as attribute toTabs.Panel
DOM element (#6711)[@mantine/core]
Tree: AddinitialCheckedState
support (#6697)[@mantine/spotlight]
FixSpotlightRoot
component not being exported (#6710)[@mantine/dropzone]
Add7z
andrar
mime types exports (#6702)[@mantine/dates]
DatePickerInput: Fix incorrect hovered date logic when the component receives value update with partial selected date range (#6718)[@mantine/dates]
FixvalueFormatter
prop being added to DateTimePicker types[@mantine/core]
Badge: Fix right/left sections height affecting the alignment of the label[@mantine/core]
Menu: Fix accessibility warning in devtools when the Menu is opened (#6644)
New Contributors
- @timesince made their first contribution in #6654
- @tokyojack made their first contribution in #6718
- @Streusel made their first contribution in #6702
- @fredgig made their first contribution in #6697
- @chimericdream made their first contribution in #6683
- @Aybrea made their first contribution in #6724
Full Changelog: 7.12.1...7.12.2
7.12.1
What's Changed
[@mantine/dates]
DateInput: Fix default date being set to the current date whenminDate
is set to the future (#6646)[@mantine/core]
ScrollArea: Fix incorrect thumb::before styles[@mantine/core]
Fix incorrect active styles of buttons used inside disabled fieldset[@mantine/form]
Fixform.watch
callbacks not being fired whenform.initialize
is called (#6639)[@mantine/core]
Switch: Fix Switch shrinking when large label or description is used (#6531)[@mantine/core]
Combobox: FixCombobox.Search
overflow whenScrollArea
is used in the dropdown (#6562)[@mantine/core]
Accordion: Add missingwithProps
function (#6564)[@mantine/core]
Pill: Fix remove icon overflowing pill container if its background color was changed with Styles API (#6565)[@mantine/core]
PinInput: Allow passing props to individual input elements depending on index withgetInputProps
(#6588)[@mantine/charts]
: Fix LineChart Legend and Tooltip to support nested names (#6536)[@mantine/core]
Tooltip: Add missingTooltip.Group.extend
function (#6576)[@mantine/spotlight]
Fixlimit
prop not working correctly with actions groups (#6632)[@mantine/core]
Badge: Fix text overflow not being handled correctly (#6629)[@mantine/core]
SegmentedControl: Adddata-disabled
attribute to the root element to simplify styling with Styles API (#6625)[@mantine/core]
SegmentedControl: Fix initial position of indicator being broken when the component is used inside other element that has transitions on mount (#6622)[@mantine/core]
TagsInput: FixonKeyDown
prop not working (#6569)[@mantine/charts]
PieChart: FixvalueFormatter
not working on outside labels (#6616)[@mantine/core]
Popover: Fixapply
function ofsize
middleware not being handled correctly (#6598)[@mantine/core]
Chip: Fix incorrect checked padding forsize="xl"
(#6586)[@mantine/dates]
TimeInput: Fix incorrect focus styles of am/pm input (#6579)[@mantine/hook]
use-os: Fix incorrect iPadOS detection (#6535)[@mantine/core]
DatePickerInput: Fix incorrectaria-label
being set on the input element (#6530)[@mantine/core]
Menu: Fix incorrect Escape key handling inside Modal (#6580)
New Contributors
- @vorant94 made their first contribution in #6530
- @hajimism made their first contribution in #6539
- @ziimakc made their first contribution in #6561
- @th3fallen made their first contribution in #6579
- @david-szabo97 made their first contribution in #6586
- @bastiankistner made their first contribution in #6607
- @inx-fldu made their first contribution in #6569
- @michaelperros made their first contribution in #6622
- @risen228 made their first contribution in #6625
- @ddoemonn made their first contribution in #6629
- @yorkeJohn made their first contribution in #6632
- @raulfpl made their first contribution in #6639
- @uriFrischman made their first contribution in #6645
Full Changelog: 7.12.0...7.12.1
7.12.0 π
View changelog with demos on mantine.dev website
Notifications at any position
It is now possible to display notifications at any position on the screen
with @mantine/notifications package:
import { Button } from '@mantine/core';
import { notifications } from '@mantine/notifications';
const positions = [
'top-left',
'top-right',
'bottom-left',
'bottom-right',
'top-center',
'bottom-center',
] as const;
function Demo() {
const buttons = positions.map((position) => (
<Button
key={position}
onClick={() =>
notifications.show({
title: `Notification at ${position}`,
message: `Notification at ${position} message`,
position,
})
}
>
{position}
</Button>
));
return <Group>{buttons}</Group>;
}
Subscribe to notifications state
You can now subscribe to notifications state changes with useNotifications
hook:
function Demo() {
const [counter, { increment }] = useCounter();
const notificationsStore = useNotifications();
const showNotification = () => {
notifications.show({
title: `Notification ${counter}`,
message: 'Most notifications are added to queue',
});
increment();
};
return (
<>
<Button onClick={showNotification} mb="md">
Show notification
</Button>
<Text>Notifications state</Text>
<Code block>{JSON.stringify(notificationsStore.notifications, null, 2)}</Code>
<Text mt="md">Notifications queue</Text>
<Code block>{JSON.stringify(notificationsStore.queue, null, 2)}</Code>
</>
);
}
SemiCircleProgress component
New SemiCircleProgress component:
import { SemiCircleProgress } from '@mantine/core';
function Demo() {
return (
<SemiCircleProgress
fillDirection="left-to-right"
orientation="up"
filledSegmentColor="blue"
size={200}
thickness={12}
value={40}
label="Label"
/>
);
}
Tree checked state
Tree component now supports checked state:
import { IconChevronDown } from '@tabler/icons-react';
import { Checkbox, Group, RenderTreeNodePayload, Tree } from '@mantine/core';
import { data } from './data';
const renderTreeNode = ({
node,
expanded,
hasChildren,
elementProps,
tree,
}: RenderTreeNodePayload) => {
const checked = tree.isNodeChecked(node.value);
const indeterminate = tree.isNodeIndeterminate(node.value);
return (
<Group gap="xs" {...elementProps}>
<Checkbox.Indicator
checked={checked}
indeterminate={indeterminate}
onClick={() => (!checked ? tree.checkNode(node.value) : tree.uncheckNode(node.value))}
/>
<Group gap={5} onClick={() => tree.toggleExpanded(node.value)}>
<span>{node.label}</span>
{hasChildren && (
<IconChevronDown
size={14}
style={{ transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)' }}
/>
)}
</Group>
</Group>
);
};
function Demo() {
return <Tree data={data} levelOffset={23} expandOnClick={false} renderNode={renderTreeNode} />;
}
Disable specific features in postcss-preset-mantine
You can now disable specific features of the postcss-preset-mantine
by setting them to false
in the configuration object. This feature is available starting from
[email protected]
.
module.exports = {
'postcss-preset-mantine': {
features: {
// Turn off `light-dark` function
lightDarkFunction: false,
// Turn off `postcss-nested` plugin
nested: false,
// Turn off `lighten`, `darken` and `alpha` functions
colorMixAlpha: false,
// Turn off `rem` and `em` functions
remEmFunctions: false,
// Turn off `postcss-mixins` plugin
mixins: false,
},
},
};
Help Center updates
- Server components guide has been updated to include
Component.extend
usage in server components. - A guide on applying input focus styles has been updated to work correctly with PasswordInput and other components in which the
input
selector is not used for actual input element. - The guide on how to disable all inputs in the form now includes additional instructions for use-form.
- New Can I have color schemes other than light and dark? guide explains the difference between color scheme and theme and why Mantine does not support custom color schemes.
- New Why VSCode cannot autoimport Text component? guide explains why VSCode cannot automatically import
Text
component. - New Are Mantine components accessible? question
- New How can I focus the first input with error with use-form? question
- New How to scroll to the top of the form if the form is submitted with errors? question
- New Why my notifications are displayed at a wrong position? question
- New Why my screen is completely empty after I've added notifications package? question
- New Why can I not use value/label data structure with Autocomplete/TagsInput? question
- New Why FileButton does not work in Menu? question
- New How can I display different elements in light and dark color schemes? question
Other changes
- use-interval hook now supports
autoInvoke
option to start the interval automatically when the component mounts. - use-form with
mode="uncontrolled"
now triggers additional rerender when dirty state changes to allow subscribing to form state changes. - ScrollArea component now supports
onTopReached
andonBottomReached
props. The functions are called when the user scrolls to the top or bottom of the scroll area. - Accordion.Panel component now supports
onTransitionEnd
prop that is called when the panel animation completes.