Skip to content
Open
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
7167a58
set `display: block` for `PickersDay` component style
michelengelen Mar 13, 2026
3b6e1a3
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
michelengelen Mar 19, 2026
bd965bc
adjusted display property for weekpicker demo
michelengelen Mar 19, 2026
be24115
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
michelengelen Mar 20, 2026
0f20f67
remove `PickerDay2` and `DateRangePickerDay2` from `slots` and corres…
michelengelen Mar 20, 2026
9c64d75
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
michelengelen Mar 23, 2026
2afb06a
Merge remote-tracking branch 'origin/bugfix/21615-misaligned-days-in-…
michelengelen Mar 23, 2026
6cef43a
fixed variable declaration
michelengelen Mar 23, 2026
abc2d03
fixed docs preview
michelengelen Mar 23, 2026
c8ea116
renamed `PickersDay` to `PickerDay` for naming consistency
michelengelen Mar 23, 2026
8cd164f
updated docs and api
michelengelen Mar 23, 2026
2d7a6ac
Merge remote-tracking branch 'upstream/master' into bugfix/21615-misa…
michelengelen Mar 23, 2026
524fcfe
updated incorrect component path
michelengelen Mar 23, 2026
e18f5f5
re-added `disableMargin` prop to `PickerDay` component
michelengelen Mar 23, 2026
717f11a
re-added `disableMargin` prop to `DateRangePickerDay` component
michelengelen Mar 23, 2026
28b3778
ran docs script
michelengelen Mar 23, 2026
4f58898
Merge remote-tracking branch 'upstream/master' into bugfix/21615-misa…
michelengelen Mar 23, 2026
933c216
fixed broken link in docs
michelengelen Mar 24, 2026
be45568
added `rename-pickers-day` codemod to rename `PickersDay` to `PickerD…
michelengelen Mar 24, 2026
cf93797
fixed linting error
michelengelen Mar 24, 2026
07c5d0a
fixed typescript error in codemod
michelengelen Mar 24, 2026
b712965
updated theme overrides for `PickerDay` and improved TypeScript defin…
michelengelen Mar 24, 2026
43e6cc3
fix typescript
michelengelen Mar 24, 2026
a5a3517
updated dimensions to align with the new day
michelengelen Mar 24, 2026
cc59b12
reverted unrelated change in date-fns adapter
michelengelen Mar 24, 2026
0d7bdfe
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
michelengelen Mar 24, 2026
17ab65d
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
michelengelen Mar 24, 2026
02d5ffc
fixed unwanted change
michelengelen Mar 24, 2026
1d7a55a
removed unneeded variables from CSS
michelengelen Mar 24, 2026
10dee20
Merge remote-tracking branch 'origin/bugfix/21615-misaligned-days-in-…
michelengelen Mar 24, 2026
d7ace3c
added `isDayFillerCell` prop to `PickerDay` and `DateRangePickerDay` …
michelengelen Mar 24, 2026
89dc66d
fixed overrides resolver bug for `dayOutsideMonth`
michelengelen Mar 24, 2026
223d982
re-added `DateRangePickerDayClasses` type export to barrel file
michelengelen Mar 24, 2026
c2dc041
re-added `useLicenseVerifier` to `DateRangePickerDay` component
michelengelen Mar 24, 2026
40fa16e
removed obsolete `DateRangePickerDay` classes and updated usages
michelengelen Mar 25, 2026
b439468
extended codemod to handle template literals for `MuiPickersDay` to `…
michelengelen Mar 25, 2026
257cf53
added codemod for `PickerDay2` and `DateRangePickerDay2` removal and …
michelengelen Mar 25, 2026
e50ac3f
properly hooked up `disableMargin` prop
michelengelen Mar 25, 2026
b0a7ed5
removed unused `hidden` prop from destructure call
michelengelen Mar 25, 2026
2a53991
removed unused `borderOffset` style in `DateRangePickerDay`
michelengelen Mar 25, 2026
e98b371
updated `isDaySelected` logic in `DateRangePickerDay` to include indi…
michelengelen Mar 25, 2026
f5019f7
re-added API and demo links for `PickerDay` and `DateRangePickerDay` …
michelengelen Mar 25, 2026
d7e1715
added support for `role` prop in `PickerDay` component
michelengelen Mar 25, 2026
c63a785
Merge remote-tracking branch 'upstream/master' into bugfix/21615-misa…
michelengelen Mar 25, 2026
60da174
fixed codemod typescript issues
michelengelen Mar 25, 2026
8deb792
fixed linting error
michelengelen Mar 25, 2026
fe851af
fixed inverted condition in `overridesResolver`
michelengelen Mar 25, 2026
20a920b
added style overrides support and tests in `DateRangePickerDay` compo…
michelengelen Mar 25, 2026
84dfe84
updated `data-testid` logic for `DateRangePickerDay`, replacing neste…
michelengelen Mar 25, 2026
f34fd95
updated codemod to clean up empty `slots` props and handle variable-a…
michelengelen Mar 25, 2026
ef1586e
Merge remote-tracking branch 'upstream/master' into bugfix/21615-misa…
michelengelen Mar 25, 2026
11d87a2
fix language linting
michelengelen Mar 25, 2026
4b56acc
updated docs links
michelengelen Mar 25, 2026
d9c6d9c
updated `onClick` event type in `PickerDay` and `DateRangePickerDay` …
michelengelen Mar 25, 2026
fec2670
updated migration guide: clarified `DateRangePickerDay` margins, rena…
michelengelen Mar 25, 2026
cb53e74
added codemod to rename class keys in `PickerDay` and `DateRangePicke…
michelengelen Mar 25, 2026
d0e0290
clarified `data-testid` changes in migration guide and their impact o…
michelengelen Mar 25, 2026
b857449
re-added correct `PickerDay` entry
michelengelen Mar 25, 2026
10223ba
added codemod to rename `PickerDay2` and `DateRangePickerDay2` to `Pi…
michelengelen Mar 25, 2026
d5cbca5
first iteration on the customtheme adjustment
michelengelen Mar 25, 2026
9a72b99
Updated style overrides and class usage in tests for `PickerDay` and …
michelengelen Mar 26, 2026
185ae39
fixed the custom theme for the picker overview showcase
michelengelen Mar 26, 2026
e0bf2ad
removed `disableMargin` prop from `PickerDay` and `DateRangePickerDay…
michelengelen Mar 26, 2026
d311c21
fixed codemod tests
michelengelen Mar 26, 2026
3417afe
fixed drag n drop
michelengelen Mar 26, 2026
dc07d86
Updated codemod logic and tests for picker components to rename class…
michelengelen Mar 26, 2026
c3ca8f6
fix dragging by solidifying the date comparison in drag handler
michelengelen Mar 26, 2026
e89671d
fix typescript
michelengelen Mar 26, 2026
e40e1db
fixed tests
michelengelen Mar 26, 2026
b349416
[pickers] Merge duplicate styleOverrides in rename-picker-classes cod…
michelengelen Mar 27, 2026
548205e
[pickers] Make isFirstVisibleCell and isLastVisibleCell optional props
michelengelen Mar 27, 2026
9707126
[pickers] Restrict string replacement to MUI-prefixed class names in …
michelengelen Mar 27, 2026
2496a38
[pickers] Clean up empty slots prop and variable in remove-picker-day…
michelengelen Mar 27, 2026
c00458f
[pickers] Add remove-disable-margin codemod
michelengelen Mar 27, 2026
216dd62
[pickers] Document `day` slot and updates to `PickerDay` component st…
michelengelen Mar 27, 2026
51cd345
[pickers] Adjust `PickerDay` and `DateRangePickerDay` styles to align…
michelengelen Mar 27, 2026
e3d9e26
[pickers] Remove support for `disableMargin` and related styles
michelengelen Mar 27, 2026
dd2e7e7
[pickers] Clarify `showDaysOutsideCurrentMonth` prop behavior and def…
michelengelen Mar 27, 2026
35cc804
[pickers] Standardize and clarify `DateRangePickerDayClasses` propert…
michelengelen Mar 27, 2026
722ce3d
[pickers] Export `DAY_SIZE` and update `DAY_RANGE_SIZE` in `x-date-pi…
michelengelen Mar 27, 2026
0e9b33d
Update packages/x-date-pickers/src/PickerDay/PickerDay.types.ts
michelengelen Mar 27, 2026
0539f63
[pickers] Add `flex: 1` to `PickerDay` to improve layout consistency
michelengelen Mar 27, 2026
a9e8922
Merge remote-tracking branch 'origin/bugfix/21615-misaligned-days-in-…
michelengelen Mar 27, 2026
e4c0d6a
[pickers] Enhance `showDaysOutsideCurrentMonth` prop logic and add da…
michelengelen Mar 27, 2026
c47e909
prettier
michelengelen Mar 27, 2026
c3f8489
make linters happy
michelengelen Mar 27, 2026
4b665a3
added missing line in test file
michelengelen Mar 27, 2026
1e423e9
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
LukasTy Mar 30, 2026
e567d9c
Fix outline color
LukasTy Mar 30, 2026
3ed4da0
Align `minHeight`
LukasTy Mar 30, 2026
7981321
Fix height calculation in different heights (margin is stable)
LukasTy Mar 30, 2026
87c7df1
Prefer CSS Variables over explicit `width` and `height`
LukasTy Mar 30, 2026
2041898
Remove prop breaking other cases
LukasTy Mar 31, 2026
899a41c
Bring back previous styling examples
LukasTy Mar 31, 2026
671bc8e
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
LukasTy Mar 31, 2026
6dbf007
Merge branch 'master' into bugfix/21615-misaligned-days-in-picker
LukasTy Apr 1, 2026
9d05474
tweak
LukasTy Apr 1, 2026
e83a196
Revert unrelated changes
LukasTy Apr 1, 2026
94787d3
Revert `onDaySelect` to required
LukasTy Apr 1, 2026
9cd91ae
rebuild
LukasTy Apr 1, 2026
38b49e0
Revert `PickerDay` classes to what we currently have with `PickerDay2…
LukasTy Apr 1, 2026
3698c4d
Fix mid-selection styles and some cleanup
LukasTy Apr 1, 2026
89a5937
fix
LukasTy Apr 1, 2026
eaf01be
Address code review: cover `preset-safe` with tests
LukasTy Apr 1, 2026
0249603
Update `remove-disable-margin` codemod to prefer updating to a CSS Va…
LukasTy Apr 1, 2026
d2409b4
Add Pickers codemod master readme
LukasTy Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/data/date-pickers/base-concepts/CustomSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { PickersDay } from '@mui/x-date-pickers/PickersDay';
import { PickerDay } from '@mui/x-date-pickers/PickerDay';
import EditCalendarRoundedIcon from '@mui/icons-material/EditCalendarRounded';
import { styled } from '@mui/material/styles';
import IconButton from '@mui/material/IconButton';

const StyledButton = styled(IconButton)(({ theme }) => ({
borderRadius: theme.shape.borderRadius,
}));
const StyledDay = styled(PickersDay)(({ theme }) => ({
const StyledDay = styled(PickerDay)(({ theme }) => ({
borderRadius: theme.shape.borderRadius,
color: theme.palette.secondary.light,
...theme.applyStyles('light', {
Expand Down
4 changes: 2 additions & 2 deletions docs/data/date-pickers/base-concepts/CustomSlots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { PickersDay } from '@mui/x-date-pickers/PickersDay';
import { PickerDay } from '@mui/x-date-pickers/PickerDay';
import EditCalendarRoundedIcon from '@mui/icons-material/EditCalendarRounded';
import { styled } from '@mui/material/styles';
import IconButton from '@mui/material/IconButton';

const StyledButton = styled(IconButton)(({ theme }) => ({
borderRadius: theme.shape.borderRadius,
}));
const StyledDay = styled(PickersDay)(({ theme }) => ({
const StyledDay = styled(PickerDay)(({ theme }) => ({
borderRadius: theme.shape.borderRadius,
color: theme.palette.secondary.light,
...theme.applyStyles('light', {
Expand Down
32 changes: 0 additions & 32 deletions docs/data/date-pickers/custom-components/PickerDay2Demo.js

This file was deleted.

32 changes: 0 additions & 32 deletions docs/data/date-pickers/custom-components/PickerDay2Demo.tsx

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions docs/data/date-pickers/custom-components/PickerDay2DemoCSSVars.js

This file was deleted.

28 changes: 0 additions & 28 deletions docs/data/date-pickers/custom-components/PickerDay2DemoCSSVars.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

51 changes: 22 additions & 29 deletions docs/data/date-pickers/custom-components/custom-components.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
productId: x-date-pickers
title: Date and Time Pickers - Custom slots and subcomponents
components: DateTimePickerTabs, PickersActionBar, DatePickerToolbar, TimePickerToolbar, DateTimePickerToolbar, PickerDay2, DateRangePickerDay2, PickersCalendarHeader, PickersRangeCalendarHeader, PickersShortcuts, DateRangePickerToolbar, MonthCalendar, YearCalendar, DateCalendar
components: DateTimePickerTabs, PickersActionBar, DatePickerToolbar, TimePickerToolbar, DateTimePickerToolbar, PickersCalendarHeader, PickersRangeCalendarHeader, PickersShortcuts, DateRangePickerToolbar, MonthCalendar, YearCalendar, DateCalendar
---

# Custom slots and subcomponents
Expand Down Expand Up @@ -188,34 +188,6 @@ You can pass a custom component to replace the year button, as shown below:

{{"demo": "YearButtonComponent.js"}}

## Day

:::info
The examples below use the new components, which might need further changes on your side to adjust to the new structure.

Be sure to check that any custom styling configuration is compatible with the new structure.
:::

The `day` slot lets users change the selected day in the calendar.

You can use the `<PickerDay2 />` and `<DateRangePickerDay2 />` components to replace the day slot with a simplified DOM structure reduced to a single element.

The `::before` pseudo element is used to create the highlighting effect on the days within the selected range.

The `::after` pseudo element is used to create the previewing effect on hover.

This new structure provides a better theming and customization experience.

{{"demo": "PickerDay2Demo.js"}}

Use the `--PickerDay-horizontalMargin` and `--PickerDay-size` CSS variables to easily customize the dimensions and spacing of the day slot.

{{"demo": "PickerDay2DemoCSSVars.js"}}

Customize the look and feel by creating a custom theme with `styleOverrides`.

{{"demo": "PickerDay2DemoCustomTheme.js"}}

## Month button

This button lets users change the selected month in the `month` view.
Expand All @@ -236,6 +208,27 @@ You can pass a custom component to replace the month button, as shown below:

{{"demo": "MonthButtonComponent.js"}}

## Day

The `day` slot is available on any component that renders a calendar to select a date or a range of dates.
It lets you customize the appearance and behavior of each individual day cell.

### Component structure change

The `PickerDay` and `DateRangePickerDay` components have been simplified to use a single `ButtonBase` element.
Previously, they used multiple nested elements to render the selection and preview highlights.
These highlights are now rendered using `::before` and `::after` pseudo-elements on the root element.

This change brings several benefits:

- **Simpler DOM structure**: Fewer nested elements mean a cleaner DOM and potentially better performance.
- **Improved consistency**: Both components now follow the same implementation pattern.

However, this might affect your custom styles if you were targeting the nested elements.
For example, in `DateRangePickerDay`, the `day` class has been removed because there is no longer a separate element for the day content.

For more details on how to adapt your custom styles, check the [Day slot migration guide](/x/migration/migration-pickers-v8/#day-slot).

## Arrow switcher

The following slots let you customize how to render the buttons and icons for an arrow switcher: the component used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const getDensePickerTheme = (mode) => ({
fontSize: 13,
},
components: {
MuiDateRangePickerDay2: {
MuiDateRangePickerDay: {
styleOverrides: {
root: {
'--PickerDay-horizontalMargin': '8px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const getDensePickerTheme = (mode: PaletteMode): ThemeOptions => ({
fontSize: 13,
},
components: {
MuiDateRangePickerDay2: {
MuiDateRangePickerDay: {
styleOverrides: {
root: {
'--PickerDay-horizontalMargin': '8px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dayjs from 'dayjs';
import Badge from '@mui/material/Badge';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { PickersDay } from '@mui/x-date-pickers/PickersDay';
import { PickerDay } from '@mui/x-date-pickers/PickerDay';
import { DateCalendar } from '@mui/x-date-pickers/DateCalendar';
import { DayCalendarSkeleton } from '@mui/x-date-pickers/DayCalendarSkeleton';

Expand Down Expand Up @@ -46,7 +46,7 @@ function ServerDay(props) {
overlap="circular"
badgeContent={isSelected ? '🌚' : undefined}
>
<PickersDay {...other} outsideCurrentMonth={outsideCurrentMonth} day={day} />
<PickerDay {...other} outsideCurrentMonth={outsideCurrentMonth} day={day} />
</Badge>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dayjs, { Dayjs } from 'dayjs';
import Badge from '@mui/material/Badge';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { PickersDay, PickersDayProps } from '@mui/x-date-pickers/PickersDay';
import { PickerDay, PickerDayProps } from '@mui/x-date-pickers/PickerDay';
import { DateCalendar } from '@mui/x-date-pickers/DateCalendar';
import { DayCalendarSkeleton } from '@mui/x-date-pickers/DayCalendarSkeleton';

Expand Down Expand Up @@ -34,7 +34,7 @@ function fakeFetch(date: Dayjs, { signal }: { signal: AbortSignal }) {

const initialValue = dayjs('2022-04-17');

function ServerDay(props: PickersDayProps & { highlightedDays?: number[] }) {
function ServerDay(props: PickerDayProps & { highlightedDays?: number[] }) {
const { highlightedDays = [], day, outsideCurrentMonth, ...other } = props;

const isSelected =
Expand All @@ -46,7 +46,7 @@ function ServerDay(props: PickersDayProps & { highlightedDays?: number[] }) {
overlap="circular"
badgeContent={isSelected ? '🌚' : undefined}
>
<PickersDay {...other} outsideCurrentMonth={outsideCurrentMonth} day={day} />
<PickerDay {...other} outsideCurrentMonth={outsideCurrentMonth} day={day} />
</Badge>
);
}
Expand Down
Loading
Loading