0
# Deprecated Components
1
2
Many components previously available in MUI Lab have been moved to dedicated packages for better maintainability and feature development. These components remain in `@mui/lab` as deprecated stubs that show warning messages and return null.
3
4
## Migration Overview
5
6
When you import and use any of the deprecated components, you'll see a console warning with migration instructions and a link to more information.
7
8
## Date/Time Pickers → @mui/x-date-pickers
9
10
All date and time picker components have been moved to the `@mui/x-date-pickers` package.
11
12
### Deprecated Components
13
14
```typescript { .api }
15
// All these components are deprecated and show warnings
16
export { CalendarPicker } from '@mui/lab';
17
export { ClockPicker } from '@mui/lab';
18
export { DatePicker } from '@mui/lab';
19
export { DateRangePicker } from '@mui/lab';
20
export { DateTimePicker } from '@mui/lab';
21
export { TimePicker } from '@mui/lab';
22
23
// Desktop variants
24
export { DesktopDatePicker } from '@mui/lab';
25
export { DesktopDateRangePicker } from '@mui/lab';
26
export { DesktopDateTimePicker } from '@mui/lab';
27
export { DesktopTimePicker } from '@mui/lab';
28
29
// Mobile variants
30
export { MobileDatePicker } from '@mui/lab';
31
export { MobileDateRangePicker } from '@mui/lab';
32
export { MobileDateTimePicker } from '@mui/lab';
33
export { MobileTimePicker } from '@mui/lab';
34
35
// Static variants
36
export { StaticDatePicker } from '@mui/lab';
37
export { StaticDateRangePicker } from '@mui/lab';
38
export { StaticDateTimePicker } from '@mui/lab';
39
export { StaticTimePicker } from '@mui/lab';
40
41
// Utilities and supporting components
42
export { CalendarPickerSkeleton } from '@mui/lab';
43
export { PickersDay } from '@mui/lab';
44
export { DateRangePickerDay } from '@mui/lab';
45
export { MonthPicker } from '@mui/lab';
46
export { YearPicker } from '@mui/lab';
47
48
// Localization and adapters
49
export { LocalizationProvider } from '@mui/lab';
50
export { AdapterDateFns } from '@mui/lab';
51
export { AdapterDayjs } from '@mui/lab';
52
export { AdapterLuxon } from '@mui/lab';
53
export { AdapterMoment } from '@mui/lab';
54
```
55
56
### Migration Examples
57
58
```typescript
59
// OLD (deprecated)
60
import { DatePicker, LocalizationProvider, AdapterDateFns } from '@mui/lab';
61
62
// NEW (recommended)
63
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
64
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
65
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
66
67
// OLD (deprecated)
68
import { DesktopDateTimePicker } from '@mui/lab';
69
70
// NEW (recommended)
71
import { DesktopDateTimePicker } from '@mui/x-date-pickers/DesktopDateTimePicker';
72
```
73
74
### Installation
75
76
```bash
77
npm install @mui/x-date-pickers
78
79
# For date-fns adapter
80
npm install date-fns
81
82
# For dayjs adapter
83
npm install dayjs
84
85
# For luxon adapter
86
npm install luxon
87
88
# For moment adapter
89
npm install moment
90
```
91
92
## Tree Components → @mui/x-tree-view
93
94
Tree components have been moved to a dedicated package for enhanced functionality.
95
96
### Deprecated Components
97
98
```typescript { .api }
99
// These components show deprecation warnings
100
export { TreeView } from '@mui/lab';
101
export { TreeItem } from '@mui/lab';
102
```
103
104
### Migration Examples
105
106
```typescript
107
// OLD (deprecated)
108
import { TreeView, TreeItem } from '@mui/lab';
109
110
// NEW (recommended)
111
import { TreeView } from '@mui/x-tree-view/TreeView';
112
import { TreeItem } from '@mui/x-tree-view/TreeItem';
113
114
// Or import from package root
115
import { TreeView, TreeItem } from '@mui/x-tree-view';
116
```
117
118
### Installation
119
120
```bash
121
npm install @mui/x-tree-view
122
```
123
124
## LoadingButton → @mui/material/Button
125
126
The LoadingButton functionality has been integrated into the core Button component.
127
128
### Deprecated Component
129
130
```typescript { .api }
131
// This component shows deprecation warnings
132
export { LoadingButton } from '@mui/lab';
133
```
134
135
### Migration Example
136
137
```typescript
138
// OLD (deprecated)
139
import { LoadingButton } from '@mui/lab';
140
141
function MyComponent() {
142
return (
143
<LoadingButton loading={isLoading} variant="contained">
144
Submit
145
</LoadingButton>
146
);
147
}
148
149
// NEW (recommended)
150
import { Button } from '@mui/material';
151
152
function MyComponent() {
153
return (
154
<Button loading={isLoading} variant="contained">
155
Submit
156
</Button>
157
);
158
}
159
```
160
161
## Warning Messages
162
163
When you use any deprecated component, you'll see console warnings like:
164
165
```
166
MUI: The DatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`.
167
168
You should use `import { DatePicker } from '@mui/x-date-pickers'`
169
or `import { DatePicker } from '@mui/x-date-pickers/DatePicker'`
170
171
More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
172
```
173
174
## Migration Resources
175
176
- [Date Pickers Migration Blog Post](https://mui.com/blog/lab-date-pickers-to-mui-x/)
177
- [Tree View Migration Blog Post](https://mui.com/blog/lab-tree-view-to-mui-x/)
178
- [MUI X Date Pickers Documentation](https://mui.com/x/react-date-pickers/)
179
- [MUI X Tree View Documentation](https://mui.com/x/react-tree-view/)
180
181
## Removal Timeline
182
183
These deprecated components will be removed in a future major version of MUI Lab. It's recommended to migrate as soon as possible to take advantage of new features and bug fixes in the dedicated packages.