Skip to content

Releases

9.8.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 09:48
  • [@mantine/core] ScrollArea: Fix onBottomReached not being called when viewport height is fractional (#9420)
  • [@mantine/core] Popover: Fix overlay transition ignoring zero duration (#9419)
  • [@mantine/form] Keep errors with their records when reordering list items (#9408)
  • [@mantine/core] Color functions: Fix space-separated rgb() colors parsing (#9407)
  • [@mantine/hooks] use-disclosure: Fix onOpen/onClose firing multiple times in StrictMode (#9404)
  • [@mantine/schedule] WeekView: Fix weekday buttons accessible name not containing visible text (#9401)
  • [@mantine/hooks] use-resize-observer: Respect explicit content-box measurements (#9400)
  • [@mantine/core] Modal: Disable pointer events on overlay when closed or exiting (#9398)
  • [@mantine/core] Combobox: Fix empty group labels rendered when search filters out all group items (#9393)
  • [@mantine/dates] DatePickerInput, MonthPickerInput, YearPickerInput, DateTimePicker: Fix dropdown aria-labelledby referencing a missing element (#9390)
  • [@mantine/dates] TimePicker: Sync fields and hidden input with clamped value on paste (#9388)
  • [@mantine/form] useForm: Fix clearFieldError being dropped when called in the same tick as other updates (#9385)
  • [@mantine/schedule] MobileMonthView: Show events on outside days (#9384)
  • [@mantine/core] Tabs: Activate tabs on Home and End keys (#9382)
  • [@mantine/hooks] use-hotkeys: Normalize physical letter codes case-insensitively (#9381)
  • [@mantine/hooks] use-scroller: Update controls on content resize (#9379)
  • [@mantine/core] Tour: Fix tooltip going off screen when the target has no room on any side (#9367)
  • [@mantine/schedule] ResourcesWeekView: Add compact day-cell layout
  • [@mantine/core] PhoneInput: Fix incorrect click behavior on the dropdown trigger button
  • [@mantine/core] PhoneInput: Add phone extension support
  • [@mantine/core] Table: Fix sticky header borders with spanning cells
  • [@mantine/core] PhoneInput: Fix national prefix handling and shared dial code selection
  • [@mantine/core] Fix theme.cursorType not affecting some components

9.8.0 🤭

Choose a tag to compare

@github-actions github-actions released this 09 Nov 07:16

View changelog with demos on mantine.dev website

Support Mantine development

You can now sponsor Mantine development with OpenCollective.
All funds are used to improve Mantine and create new features and components.

@mantine/emoji package

New @mantine/emoji package provides emoji picker components. It works with any emoji
data source through adapters, emoji-mart
and emojibase-data adapters are included.

EmojiPicker

EmojiPicker displays a searchable emoji grid with category navigation,
skin tone selector, and emoji preview.

import data from '@emoji-mart/data';
import { emojiMartAdapter, EmojiPicker } from '@mantine/emoji';

const emojiData = emojiMartAdapter(data);

function Demo() {
  return (
    <EmojiPicker
      data={emojiData}
      onEmojiSelect={(emoji) => console.log(emoji)}
    />
  );
}

EmojiPickerInput

EmojiPickerInput is an input with an emoji picker dropdown.
It supports all standard input features like labels, descriptions, error messages, and sizes.

import data from '@emoji-mart/data';
import { emojiMartAdapter, EmojiPickerInput } from '@mantine/emoji';

const emojiData = emojiMartAdapter(data);

function Demo() {
  return <EmojiPickerInput data={emojiData} variant="default" size="sm" radius="md" label="Input label" withAsterisk={false} description="Input description" error="" placeholder="Select emoji" />;
}

EmojiPickerPopover

EmojiPickerPopover renders an emoji picker inside a popover dropdown.
Use it to build custom emoji picker triggers.

import { useState } from 'react';
import { ActionIcon } from '@mantine/core';
import data from '@emoji-mart/data';
import { emojiMartAdapter, EmojiPickerPopover } from '@mantine/emoji';

const emojiData = emojiMartAdapter(data);

function Demo() {
  const [emoji, setEmoji] = useState<string | null>(null);

  return (
    <EmojiPickerPopover
      data={emojiData}
      onEmojiSelect={(e) => setEmoji(e.emoji)}
    >
      <ActionIcon variant="default" size="lg">
        {emoji || '☺'}
      </ActionIcon>
    </EmojiPickerPopover>
  );
}

Diff component

New Diff component highlights differences between two strings.
It supports unified and split (side-by-side) display modes, configurable diff
granularity (characters, words, or lines), and context line collapsing.

// Demo.tsx
import { Diff } from '@mantine/code-highlight';
import { currentCode, previousCode } from './data';

function Demo() {
  return <Diff previousValue={previousCode} currentValue={currentCode} />;
}

// data.ts
export const previousCode = \`import { useState } from 'react';

function Counter() {
  const [count, setCount] = useState(0);
  return (
    <button onClick={() => setCount(count + 1)}>
      Count: {count}
    </button>
  );
}\

PhoneInput component

New PhoneInput component provides an international phone number input
with country selector, auto-detection, and formatting masks.

import { PhoneInput } from '@mantine/core';

function Demo() {
  return (
    <PhoneInput
      label="Phone number"
      placeholder="Your phone number"
      defaultCountry="us"
      renderFlag={(country) => (
        <img
          src={`https://hatscripts.github.io/circle-flags/flags/${country?.iso2 ?? 'xx'}.svg`}
          alt={country?.name ?? 'Select country'}
          style={{ width: 20, height: 20, borderRadius: 20 }}
        />
      )}
    />
  );
}

MaskedDateInput component

New MaskedDateInput component provides a date input with
individual masked fields for day, month, and year. It supports configurable field order,
custom separators, optional time fields, and a calendar dropdown for date selection.

import { MaskedDateInput } from '@mantine/dates';

function Demo() {
  return <MaskedDateInput label="Date of birth" />;
}

QuarterPicker and QuarterPickerInput components

New QuarterPicker and QuarterPickerInput components
allow picking quarters, multiple quarters and quarters ranges. They work the same way as MonthPicker
and MonthPickerInput; the value is the first day of the selected quarter in YYYY-MM-DD format.


WeekPicker and WeekPickerInput components

New WeekPicker and WeekPickerInput components
allow picking weeks, multiple weeks and weeks ranges. Clicking any day selects the whole week,
the value is the first day of the week according to firstDayOfWeek in YYYY-MM-DD format.


use-active-element hook

New use-active-element hook tracks the element that currently has focus.
Use it to build focus-aware UI or to disable global keyboard shortcuts while the user is typing:

import { Code, Group, Text, Textarea, TextInput } from '@mantine/core';
import { useActiveElement } from '@mantine/hooks';

function describe(element: Element | null) {
  if (!element) {
    return 'null';
  }

  return element.id ? `${element.tagName.toLowerCase()}#${element.id}` : element.tagName.toLowerCase();
}

function Demo() {
  const activeElement = useActiveElement();

  return (
    <>
      <Text>
        Focused element: <Code>{describe(activeElement)}</Code>
      </Text>

      <Group grow mt="md">
        <TextInput id="first-name" label="First name" placeholder="First name" />
        <TextInput id="last-name" label="Last name" placeholder="Last name" />
      </Group>

      <Textarea id="message" mt="md" label="Message" placeholder="Your message" />
    </>
  );
}

use-browser-language hook

New use-browser-language hook returns the browser language and
updates when the user changes it. Use it to pick a default locale for formatting or translations:

import { Code, Text } from '@mantine/core';
import { useBrowserLanguage } from '@mantine/hooks';

function Demo() {
  const language = useBrowserLanguage();

  return (
    <Text>
      Your browser language: <Code>{language ?? 'unknown'}</Code>
    </Text>
  );
}

Mentions component

New Mentions component is a textarea that opens a suggestions dropdown when
the user types @ or any other trigger. Picked mentions are stored in the value as @[Display](id)
markup, the user sees only the display text:

import { useState } from 'react';
import { Mentions } from '@mantine/core';

const users = [
  { id: 'walter', display: 'Walter White' },
  { id: 'jesse', display: 'Jesse Pinkman' },
  { id: 'saul', display: 'Saul Goodman' },
  { id: 'gus', display: 'Gustavo Fring' },
];

function Demo() {
  const [value, setValue] = useState('Hey @[Walter White](walter), are you ready?');

  return (
    <Mentions
      label="Comment"
      placeholder="Type @ to mention someone"
      value={value}
      onChange={(payload) => setValue(payload.value)}
      minRows={3}
    >
      <Mentions.Mention trigger="@" data={users} />
    </Mentions>
  );
}

Other changes

  • DayView and WeekView support slotLabelInterval prop to display time labels more often than once per hour
  • DayView and WeekView businessHours prop accepts exact minutes, business hours colors can be changed with CSS variables
  • MobileMonthView supports withWeekendDays prop to hide weekend days
  • ScrollArea supports --scrollarea-offset-size CSS variable to change the gap reserved by offsetScrollbars
  • Popover and components based on it support clickOutsideCapture prop to close the dropdown when the click target stops event propagation
  • getUploadImageExtension in @mantine/tiptap uploads images embedded in pasted HTML, use shouldUploadPastedImage option to control which images are uploaded
  • Keyboard navigation in DatePicker and other @mantine/dates pickers has been improved: arrow keys move focus across months and focus returns to the input when the dropdown closes
  • @mantine/form exports UseContextForm type
  • Notifications support autoCloseProgressPosition prop to display the auto close progress line at the top of the notification

9.7.5

Choose a tag to compare

@github-actions github-actions released this 04 Nov 12:37
  • [@mantine/tiptap] Keep aria-pressed on toggle controls in both states (#9376)
  • [@mantine/core] Indicator: Respect reduced motion in the processing animation (#9375)
  • [@mantine/schedule] YearView: Fix multi-day events not showing when they start in the previous year (#9374)
  • [@mantine/dates] Use dayjs to create years in YearsList and CalendarHeader (#9372)
  • [@mantine/core] NumberInput: Fix inputMode prop being overridden (#9371)
  • [@mantine/core] Tour: Add position="center" to Tour.Step to place the tooltip over the target (#9369)
  • [@mantine/charts] BarChart: Fix waterfall type mutating the data prop (#9365)
  • [@mantine/hooks] use-mask: Fix autofill keydown errors (#9362)
  • [@mantine/core] Combobox: Fix hidden input dropping falsy values (#9359)
  • [@mantine/core] Popover: Fix preventPositionChangeWhenVisible not locking dropdown side on open (#9358)
  • [@mantine/hooks] use-move: End scrubbing when touch is canceled (#9354)
  • [@mantine/hooks] use-focus-within: Keep focus within SVG descendants (#9353)
  • [@mantine/hooks] use-window-event: Update event listener options (#9352)
  • [@mantine/hooks] use-scroller: Track delayed and replaced containers (#9351)
  • [@mantine/hooks] use-resize-observer: Prevent render loops with inline options (#9350)
  • [@mantine/hooks] use-long-press: Prevent duplicate timers on overlapping presses (#9349)
  • [@mantine/hooks] use-input-state: Fix setter type to accept callbacks (#9347)
  • [@mantine/mcp-server] get_api: Resolve symbols documented in guide pages (#9341) (#9346)
  • [@mantine/core] Cascader: Fix keyboard navigation not being ignored during IME composition (#9343)
  • [@mantine/core] MultiSelect, TreeSelect: Fix Backspace removing the last value during IME composition (#9340)
  • [@mantine/hooks] use-scroll-into-view: Clamp animation progress before easing (#9338)
  • [@mantine/hooks] use-timeout: Fix callback restarts and error recovery (#9336)
  • [@mantine/schedule] MonthView: Fix ArrowLeft and ArrowRight not being mirrored in RTL (#9335)
  • [@mantine/core] TreeSelect: Fix ArrowLeft and ArrowRight not being mirrored in RTL (#9334)
  • [@mantine/core] Fix leading decimal values being treated as theme sizes (#9333)
  • [@mantine/core] Menu: Keep explicit aria-disabled on items and Menubar targets (#9332)
  • [@mantine/dates] Calendar: Fix ArrowLeft and ArrowRight not being mirrored in RTL (#9330)
  • [@mantine/hooks] use-hash: Keep setter state consistent with the URL (#9328)
  • [@mantine/core] Parse four-digit hex colors in color functions (#9327)
  • [@mantine/schedule] Add eventTimeFormat prop support to AgendaView, MobileMonthView, DayView, WeekView, MonthView and Schedule components (#9356)
  • [@mantine/core] Add loaderProps support to all input components

9.7.4

Choose a tag to compare

@github-actions github-actions released this 25 Oct 20:15
  • [@mantine/schedule] Fix time slot labels showing wrong time on daylight saving time days in DayView, WeekView, ResourcesDayView, ResourcesWeekView (#9320)
  • [@mantine/hooks] use-mask: Fix generatePattern output being rejected by browsers for masks with # token (#9326)
  • [@mantine/core] NavLink: Add aria-expanded to links with children (#9325)
  • [@mantine/core] Menu: Add aria-disabled to items and Menubar targets with data-disabled (#9323)
  • [@mantine/core] Preserve zero alpha when converting hsla colors (#9321)
  • [@mantine/schedule] DayView, WeekView: Fix events and current time indicator being positioned at wrong time on daylight saving time days (#9317)
  • [@mantine/schedule] DayView: Fix multi-day events starting at midnigh… (#9315)
  • [@mantine/core] ScrollArea: Stop thumb animation loop on cleanup (#9314)
  • [@mantine/hooks] use-clipboard: Reset copied state on error (#9310)
  • [@mantine/hooks] use-hover: Fix listeners not being removed when React detaches the ref (#9309)
  • [@mantine/core] TagsInput: Fix readOnly not preventing value changes on paste (#9308)
  • [@mantine/core] Tree: Fix ArrowLeft and ArrowRight not being mirrored in RTL (#9307)
  • [@mantine/core] SegmentedControl: Fix readOnly prop description (#9306)
  • [@mantine/core] Checkbox: Forward readOnly attribute to the input (#9305)
  • [@mantine/core] AppShell: Keep the context value stable when the shell re-renders after mounting (#9304)
  • [@mantine/core] Menu: Fix ArrowLeft and ArrowRight not being mirrored in RTL submenus (#9302)
  • [@mantine/core] Menu: Fix focus not returning to the submenu target on ArrowLeft (#9301)
  • [@mantine/hooks] use-local-storage: Fix stale value after key change (#9298)
  • [@mantine/charts] Support Recharts legend position (#9297)
  • [@mantine/hooks] use-fetch: Fix stale error and loading state when a request is replaced or aborted (#9296)
  • [@mantine/core] SegmentedControl: Fix indicator position not being changed when data array is reordered

9.7.3

Choose a tag to compare

@github-actions github-actions released this 17 Oct 12:28
  • [@mantine/schedule] Add slotLabelInterval prop to DayView and WeekView to display time labels more often than once per hour
  • [@mantine/schedule] Add option to customize business hours minutes and change colors
  • [@mantine/schedule] MobileMonthView: Add withWeekendDays prop
  • [@mantine/charts] Fix right Y axis children rendering (#9295)
  • [@mantine/hooks] use-scroller: Fix next click being ignored after a drag ends by leaving the container (#9294)
  • [@mantine/hooks] use-event-listener: Fix listener being removed after re-render when options object is passed inline (#9292)
  • [@mantine/core] ScrollArea: Add --scrollarea-offset-size CSS variable (#9290)
  • [@mantine/core] Cascader: Fix ArrowLeft and ArrowRight not being mirrored in RTL (#9286)
  • [@mantine/hooks] use-throttled-callback: Handle reentrant calls (#9284)
  • [@mantine/core] Radio, Chip: Fix readOnly prop not preventing value changes (#9282)
  • [@mantine/core] Select: Fix onChange option argument type not including null (#9281)
  • [@mantine/core] Switch: Fix readOnly prop not preventing toggle (#9280)
  • [@mantine/core] Fix searchable inputs ignoring typing when rendered in another window or iframe (#9278)
  • [@mantine/hooks] use-focus-trap: Fix focus not being fully trapped when used with macOS Full Keyboard Access off

9.7.2

Choose a tag to compare

@github-actions github-actions released this 11 Oct 09:13
  • [@mantine/core] PinInput: Fix readOnly not preventing value changes on Delete, Backspace and paste (#9258)
  • [@mantine/core] Divider: Add aria-orientation (#9259)
  • [@mantine/core] Tooltip: Fix disabled tooltip setting aria-describedby on its target (#9261)
  • [@mantine/core] Transition: Fix frames and callbacks running after unmount during the first frame (#9263)
  • [@mantine/hooks] use-scroll-into-view: Reset start time on cancel (#9265)
  • [@mantine/core] Fix Backspace removing the last value when readOnly is set in MultiSelect and TreeSelect components (#9267)
  • [@mantine/schedule] ResourcesDayView: Fix sticky resource labels covering the time labels row (#9268)
  • [@mantine/hooks] use-debounced-callback: Avoid repeating completed leading calls (#9269)
  • [@mantine/schedule] MobileMonthView: Fix multi-day event time display on start, middle and end days (#9272)
  • [@mantine/form] Add UseContextForm type export (#9275)
  • [@mantine/form] Fix potential global prototype position
  • [@mantine/tiptap] Add option to handle images pasted with other rich text elements in the image extension (#9270)

9.7.1

Choose a tag to compare

@github-actions github-actions released this 06 Oct 12:35
  • [@mantine/schedule] Fix startScrollTime scroll position (#9255)
  • [@mantine/core] RollingNumber: Fix sub-pixel digit misalignment at fractional zoom levels (#9251)
  • [@mantine/core] Tree: Add aria-expanded to tree items with children (#9247)
  • [@mantine/core] SegmentedControl: Do not call Math.random during render (#9245)
  • [@mantine/core] Popover: Add capture prop to control events capturing phase (#9243)
  • [@mantine/form] Fix clearing state of unrelated fields (#9242)
  • [@mantine/core] AngleSlider: Set aria-disabled on thumb when disabled (#9238)
  • [@mantine/core] Combobox: Set aria-disabled on disabled Combobox.Option (#9236)
  • [@mantine/form] Fix reorderListItem moving errors of items whose index shares a prefix with the reordered index (#9235)
  • [@mantine/schedule] MonthView: Fix quadratic row assignment for weeks with many events (#9232)
  • [@mantine/hooks] use-pagination: Fix single page being replaced with dots on the right side (#9229)
  • [@mantine/core] ScrollArea: Fix wheel listener on document blocking compositor scrolling for the whole page (#9225)
  • [@mantine/dates] DateTimePicker: Fix time not being limited by minDate and maxDate (#9221)
  • [@mantine/core] Select, MultiSelect, Autocomplete, TagsInput: Fix listbox aria-labelledby referencing a missing label element (#9219) (#9220)
  • [@mantine/hooks] use-debounced-state: Fix leading edge firing only once (#9214)

9.7.0 😳

Choose a tag to compare

@github-actions github-actions released this 05 Oct 08:10

View changelog with demos on mantine.dev website

Support Mantine development

You can now sponsor Mantine development with OpenCollective.
All funds are used to improve Mantine and create new features and components.

@mantine/mcp-server documentation coverage

@mantine/mcp-server now exposes 406 documentation
pages instead of 164. Previously only components were indexed – hooks, @mantine/form,
styling, theming, guides and help.mantine.dev FAQ pages are now included as
well. Changelog pages are deliberately excluded to keep search results focused on current APIs.

Documentation is now retrieved by section rather than by whole page. get_item_doc returns a page
outline (description, import statement and the list of section headings) by default, a single section
with the section argument, or the entire page with full: true. Requesting useForm this way returns
about 1KB instead of 9KB, and the largest pages drop from roughly 89KB to 4KB.

Other improvements:

  • New get_api tool – resolves a symbol such as useForm or useDisclosure to its TypeScript
    signature and exported types without knowing which page documents it
  • Ranked search – search_docs results point at the specific section that matched, so a query like
    "validate a form with zod" resolves to the zod section of the schema validation page
  • Search synonyms – queries now match the search keywords maintained in the documentation, so
    "command palette" finds Spotlight
  • More filters – list_items accepts group, category and package in addition to kind
  • Hook signatures – get_item_props returns the TypeScript signature for hooks, and points at the
    relevant section for pages that document their API in prose

The server was also migrated to the official Model Context Protocol SDK, so the protocol version is
negotiated with the client instead of being pinned.

For setup details, supported tools, and client-specific instructions, see Mantine with LLMs.

Tour component

New Tour component provides interactive step-by-step application onboarding.
It highlights target elements with a spotlight overlay and displays tooltips with navigation controls.
Supports both guided (sequential) and beacon (non-sequential) modes.

Toolbar component

New Toolbar component provides an accessible toolbar container with roving tabindex
keyboard navigation, toggle groups with single/multiple selection, visual grouping, and dividers.
Styling is similar to RichTextEditor toolbar.

Toggle component

New Toggle component is a button that can be toggled between active and inactive states:

JsonViewer component

New JsonViewer component can be used to display complex JSON
structures with expand/collapse, type indicators, copy to clipboard, and other features:

Light Checkbox and Radio variant

Checkbox and Radio components now support variant="light" –
the indicator uses a light background color with a colored icon, similar to the light variant
available in other components like Button:

import { Radio, Checkbox, Stack } from '@mantine/core';

function Demo() {
  return (
    <Stack gap={7}>
      <Checkbox variant="light" label="Light Checkbox" defaultChecked />
      <Checkbox variant="light" label="Light indeterminate Checkbox" indeterminate />
      <Radio variant="light" label="Light Radio" defaultChecked />
    </Stack>
  );
}

RichTextEditor image upload

RichTextEditor now supports image upload with loading states.
Images can be uploaded via toolbar button, drag and drop, or paste.
During upload, a local preview is shown with a loading indicator.

Configuring getUploadImageExtension is enough to enable uploads – onImageUpload and
onImageUploadError props of RichTextEditor are optional overrides for the toolbar control.
onImageUpload can resolve either to a string or to { src, alt, title } (new exported
ImageUploadResult type) to set alternative text on the uploaded image. Several files picked,
dropped or pasted together are inserted in the order they were selected and are undone as one step.

import TipTapImage from '@tiptap/extension-image';
import { useEditor } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import { getUploadImageExtension, ImageUploadResult, RichTextEditor } from '@mantine/tiptap';

function handleImageUpload(file: File): Promise<ImageUploadResult> {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({ src: URL.createObjectURL(file), alt: file.name });
    }, 3000);
  });
}

function Demo() {
  const editor = useEditor({
    shouldRerenderOnTransaction: true,
    extensions: [
      StarterKit,
      getUploadImageExtension(TipTapImage, { onImageUpload: handleImageUpload }),
    ],
    content: '<p>Click the image button in the toolbar, or drag & drop / paste an image into the editor.</p>',
  });

  return (
    <RichTextEditor editor={editor}>
      <RichTextEditor.Toolbar>
        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Bold />
          <RichTextEditor.Italic />
        </RichTextEditor.ControlsGroup>

        <RichTextEditor.ControlsGroup>
          <RichTextEditor.ImageUpload />
        </RichTextEditor.ControlsGroup>
      </RichTextEditor.Toolbar>

      <RichTextEditor.Content />
    </RichTextEditor>
  );
}

Schedule event overlap mode

DayView and WeekView now support eventOverlapMode prop
that controls how events overlapping in time share the horizontal space. The default columns mode
splits the available width evenly between them, which becomes unreadable once a large number of events
overlap. The new cascade mode indents each event and stacks it over the previous one, so every event
keeps a readable width no matter how many of them overlap.

The indent shrinks automatically as the group grows, so the event on top always keeps at least 60% of
the available width. Covered events can still be read and used: rest the pointer on one and it is
raised above the events covering it, which also makes its resize handles reachable. Keyboard users get
the same result by focusing the event with Tab. eventOverlapRaiseDelay prop controls how long the
pointer must rest on an event before it is raised, in milliseconds (600 by default).

import { useState } from 'react';
import { SegmentedControl, Stack } from '@mantine/core';
import { ScheduleEventOverlapMode, WeekView } from '@mantine/schedule';
import { events } from './data';

function Demo() {
  const [mode, setMode] = useState<ScheduleEventOverlapMode>('cascade');

  return (
    <Stack>
      <SegmentedControl
        value={mode}
        onChange={(value) => setMode(value as ScheduleEventOverlapMode)}
        data={[
          { value: 'columns', label: 'columns' },
          { value: 'cascade', label: 'cascade' },
        ]}
      />

      <WeekView
        date={new Date()}
        events={events}
        startTime="08:00:00"
        endTime="14:00:00"
        eventOverlapMode={mode}
      />
    </Stack>
  );
}

Schedule drop validation

All Schedule views can now reject a drag or resize before it is committed,
based on where the event is being dropped rather than on which event is being dragged. Previously
canDragEvent and canResizeEvent only decided whether an event was draggable or resizable at all,
so the only way to prevent a double booking was to accept the drop, notice the conflict in the
handler and not update state – which produced a snap-back with no explanation:

  • preventEventOverlap rejects placements that would make the event overlap another event. Pass a
    function to decide per pair of events: return true to forbid that particular overlap.
  • canDropEvent and canResizeEventTo are called before a drop or resize is committed – return
    false to reject it.
  • canDropExternalEvent does the same for items dragged in from outside the schedule.
  • onEventPlacementRejected reports the rejection with the conflicting events and the reason.

The checks compose: a placement is allowed only when the overlap check passes and the matching
callback returns a value other than false. The overlap check runs first, so onEventPlacementRejected
can report conflicts without your code repeating the work. While the pointer is over an invalid
target the drag ghost and the resizing event get data-invalid, so the rejection is visible before the
pointer is released.

import { useState } from 'react';
import dayjs from 'dayjs';
import { Stack, Text } from '@mantine/core';
import { WeekView, ScheduleEventData } from '@mantine/schedule';

const startOfWeek = dayjs()
  .subtract((dayjs().day() + 6) % 7, 'day')
  .format('YYYY-MM-DD');

const initialEvents: ScheduleEventData[] = [
  {
    id: 1,
    title: 'Standup',
    start: `${startOfWeek} 09:00:00`,
    end: `${startOfWeek} 09:30:00`,
    color: 'blue',
  },
  {
    id: 2,
    title: 'Design review',
    start: `${startOfWeek} 11:00:00`,
    end: `${startOfWeek} 12:00:00`,
    color: 'grape',
  },
  {
    id:...
Read more

9.6.3

Choose a tag to compare

@github-actions github-actions released this 26 Sep 08:52
  • [@mantine/hooks] use-click-outside: Add capture phase support (#9213)
  • [@mantine/core] Select: Fix dropdown not closing on blur when searchable is not set (#9215)
  • [@mantine/core] PasswordInput: Fix aria-describedby not being taken from InputWrapperContext (#9216)
  • [@mantine/core] Fix aria-labelledby referencing a missing label element in Checkbox.Group, Radio.Group, Switch.Group (#9217)
  • [@mantine/core] Slider: Fix thumbProps not being passed to the thumb element (#9218)
  • [@mantine/core] Table: Fix memoized rows rerendering when Table rerenders with the same props (#6422)
  • [@mantine/hooks] use-intersection: Use the last entry from a batched observer callback (#9019)
  • [@mantine/hooks] use-media-query: Catch matchMedia errors when reading the initial value synchronously (#9020)
  • [@mantine/core] Portal: Cache shared portal node lookup (#9101)
  • [@mantine/schedule] MobileMonthView: Fix multi-day events not showing when they start in the previous month (#9153)
  • [@mantine/form] Fix removeListItem not clearing non-nested item errors (#9180)
  • [@mantine/core] Rating: Fix value being changed by scroll gestures on touch devices (#9159)
  • [@mantine/notifications] Fix uneven spacing in expanded stacks (#9176)
  • [@mantine/charts] Fix textColor and gridColor props being passed as attributes to the DOM node (#9181)
  • [@mantine/hooks] use-hotkeys: Fix preventDefault not being applied when other hotkey options are set (#9164)
  • [@mantine/hooks] use-throttled-callback: Fix callback becoming unresponsive after clearTimeout (#9146)
  • [@mantine/hooks] use-roving-index: Fix disabled items not being skipped by ArrowLeft/ArrowRight in grid mode (#9169)
  • [@mantine/hooks] use-mask: Fix transform not being applied to the initial input value (#9170)

9.6.2

Choose a tag to compare

@github-actions github-actions released this 21 Sep 06:54
  • [@mantine/core] Combobox: Fix incorrect aria-selected setting on up/down arrows press (#9205)
  • [@mantine/core] NumberInput: Fix min and max boundaries not being respected when trimLeadingZeroesOnBlur is false (#9192)
  • [@mantine/hooks] use-mask: Fix incorrect handling of input with mixed static values (#9196)
  • [@mantine/schedule] Add option to resize bacground events (#9190)
  • [@mantine/schedule] MobileMonthView: Fix missing localization for all day events label (#9191)
  • [@mantine/hooks] use-scroll-spy: Fix stale nodes being used when element cannot be resolved by the given selector
  • [@mantine/core] ComboboxPopover: Fix incorrect focus management
  • [@mantine/charts] GaugeChart: Fix incorrect roundCaps handling with multiple sections (#9189)
  • [@mantine/core] NumberInput: Fix incorrect thousands separator handling on paste (#9102)