# Version v9.8.0

## Support Mantine development

You can now sponsor Mantine development with [OpenCollective](https://opencollective.com/mantinedev).
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](https://www.npmjs.com/package/@emoji-mart/data)
and [emojibase-data](https://www.npmjs.com/package/emojibase-data) adapters are included.

## EmojiPicker

[EmojiPicker](https://alpha.mantine.dev/llms/emoji-emoji-picker.md) displays a searchable emoji grid with category navigation,
skin tone selector, and emoji preview.

```tsx
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](https://alpha.mantine.dev/llms/emoji-emoji-picker-input.md) is an input with an emoji picker dropdown.
It supports all standard input features like labels, descriptions, error messages, and sizes.

```tsx
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](https://alpha.mantine.dev/llms/emoji-emoji-picker-popover.md) renders an emoji picker inside a popover dropdown.
Use it to build custom emoji picker triggers.

```tsx
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](https://alpha.mantine.dev/llms/code-highlight-diff.md) 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.

```tsx
// 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](https://alpha.mantine.dev/llms/core-phone-input.md) component provides an international phone number input
with country selector, auto-detection, and formatting masks.

```tsx
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](https://alpha.mantine.dev/llms/dates-masked-date-input.md) 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.

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

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


## QuarterPicker and QuarterPickerInput components

New [QuarterPicker](https://alpha.mantine.dev/llms/dates-quarter-picker.md) and [QuarterPickerInput](https://alpha.mantine.dev/llms/dates-quarter-picker-input.md) 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](https://alpha.mantine.dev/llms/dates-week-picker.md) and [WeekPickerInput](https://alpha.mantine.dev/llms/dates-week-picker-input.md) 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](https://alpha.mantine.dev/llms/hooks-use-active-element.md) 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:

```tsx
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](https://alpha.mantine.dev/llms/hooks-use-browser-language.md) hook returns the browser language and
updates when the user changes it. Use it to pick a default locale for formatting or translations:

```tsx
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](https://alpha.mantine.dev/llms/core-mentions.md) 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:

```tsx
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](https://alpha.mantine.dev/llms/schedule-day-view.md#slot-label-interval) and [WeekView](https://alpha.mantine.dev/llms/schedule-week-view.md#slot-label-interval) support `slotLabelInterval` prop to display time labels more often than once per hour
* [DayView](https://alpha.mantine.dev/llms/schedule-day-view.md#business-hours) and [WeekView](https://alpha.mantine.dev/llms/schedule-week-view.md#business-hours) `businessHours` prop accepts exact minutes, business hours colors can be changed with CSS variables
* [MobileMonthView](https://alpha.mantine.dev/llms/schedule-mobile-month-view.md#hide-weekend-days) supports `withWeekendDays` prop to hide weekend days
* [ScrollArea](https://alpha.mantine.dev/llms/core-scroll-area.md#offset-size) supports `--scrollarea-offset-size` CSS variable to change the gap reserved by `offsetScrollbars`
* [Popover](https://alpha.mantine.dev/llms/core-popover.md#click-outside) and components based on it support `clickOutsideCapture` prop to close the dropdown when the click target stops event propagation
* `getUploadImageExtension` in [@mantine/tiptap](https://alpha.mantine.dev/llms/x-tiptap.md#pasted-html-content) uploads images embedded in pasted HTML, use `shouldUploadPastedImage` option to control which images are uploaded
* Keyboard navigation in [DatePicker](https://alpha.mantine.dev/llms/dates-date-picker.md) 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](https://alpha.mantine.dev/llms/x-notifications.md#auto-close-progress-position) support `autoCloseProgressPosition` prop to display the auto close progress line at the top of the notification
