Description
As decided in #22342 we need to migrate all the components to the @mateiral-ui/styled-engine
(emotion by default) API. We've already converted a dozen components. We are now confident with the approach. We have fixed most of the challenges it creates. This issue will help track the progress of the migration.
For converting a component, you can use as a template any of the already converted components, e.g #24397. We have also this migration guide in case you want to prepare yourself before starting, or in case if something is not working as expected.
This is a useful checklist to have when migrating a component:
General checklist:
- Update
sx
prop types - Update tests (
classes
&describeConformanceV5
usage) - Add componentClasses files
- Export componentClasses from
index.js
&index.d.ts
Component checklist:
-
useThemeProps
,useUtilityClasses
are used and correct (styleProps
need to be created) - slots styles are converted to separate
styled()
components (exampleButtonLabel
) -
styleProps
andclasses
are spread on root and all slots correctly - if there is component prop, it is used like
as={component}
on the Root slot - $slot are converted to [
& .${componentClasses.slot}
]
Here is a list of all components with their status:
Note: if you see that the components depends on some other components, then those components need to be converted first, before the component itself can be migrated.
@material-ui/core
- Accordion [Accordion] Migrate to emotion #24518
- AccordionActions [Accordion] Migrate AccordionActions to emotion #24538
- AccordionDetails [Accordion] Migrate AccordionDetails to emotion #24539
- AccordionSummary [Accordion] Migrate AccordionSummary to emotion #24540
- Alert [Alert] Migrate to emotion #24442
- AlertTitle [Alert] Migrate AlertTitle to emotion #24448
- AppBar [AppBar] Migrate to emotion #24439
- Autocomplete - depends on
ListSubheader
,Chip
[Autocomplete] Migrate to emotion #24696 - Avatar
- AvatarGroup [Avatar] Migrate AvatarGroup to emotion #24452
- Backdrop [Backdrop] Migrate to emotion #24523
- Badge
- BottomNavigation [BottomNavigation] Migrate to emotion #24556
- BottomNavigationAction [BottomNavigation] Migrate to emotion #24556
- Box
- Breadcrumbs [Breadcrumbs] Migrate to emotion #24522
- Button
- ButtonBase
- ButtonGroup [ButtonGroup] Migrate ButtonGroup to emotion #24775
- Card [Card] Migrate to emotion #24597
- CardActionArea [Card] Migrate CardActionArea to emotion #24636
- CardActions [Card] Migrate CardActions to emotion #24604
- CardContent [Card] Migrate CardContent to emotion #24600
- CardHeader [Card] Migrate CardHeader to emotion #24626
- CardMedia [Card] Migrate CardMedia to emotion #24625
- Checkbox - depends on
SwitchBase
[Checkbox] Migrate to emotion #24702 - Chip [Chip] Migrate to emotion #24649
- CircularProgress [CircularProgress] Migrate to emotion #24622
-
ClickAwayListenerNO_NEED_FOR_CONVERSION - Collapse [Collapse] Migrate to emotion #24501
- Container
- CssBaseline
- Dialog [Dialog] Migrate Dialog to emotion #25216
- DialogActions [Dialog] Migrate DialogActions to emotion #24613
- DialogContent [Dialog] Migrate DialogContent to emotion #24670
- DialogContentText [Dialog] Migrate DialogContentText to emotion #25267
- DialogTitle [Dialog] Migrate DialogTitle to emotion #24623
- Divider [Divider] Migrate to emotion #24558
- Drawer - depends on
Modal
[Drawer] Migrate to emotion #25091 - Fab [Fab] Migrate to emotion #24618
-
FadeNO_NEED_FOR_CONVERSION - FilledInput - depends on
InputBase
[TextField] Migrate FilledInput to emotion #24634 - FormControl [TextField] Migrate FormControl to emotion #24659
- FormControlLabel [TextField] Migrate FormControlLabel to emotion #25007
- FormGroup [TextField] Migrate FormGroup to emotion #24685
- FormHelperText [TextField] Migrate FormHelperText to emotion #24661
- FormLabel [TextField] Migrate FormLabel and InputLabel to emotion #24665
- GlobalStyles
- Grid [Grid] Migrate to emotion #24395
-
GrowNO_NEED_FOR_CONVERSION - Hidden [Hidden] Migrate to emotion #24544
- Icon [Icon] Migrate to emotion #24516
- IconButton [IconButton] Migrate to emotion #24542
- ImageList [ImageList] Migrate to emotion #24615
- ImageListItem [ImageList] Migrate ImageListItem to emotion #24619
- ImageListItemBar [ImageList] Migrate ImageListItemBar to emotion #24632
- Input - depends on
InputBase
[TextField] Migrate Input component to emotion #24638 - InputAdornment [TextField] Migrate InputAdornment to emotion #25279
- InputBase [TextField] Migrate InputBase to emotion #24555
- InputLabel - depends on
FormLabel
[TextField] Migrate FormLabel and InputLabel to emotion #24665 - LinearProgress
- Link [Link] Migrate to emotion #24529
- List [List] Migrate to emotion #24560
- ListItem [List] Migrate ListItem to emotion #24543
- ListItemAvatar [List] Migrate ListItemAvatar to emotion #24656
- ListItemIcon [List] Migrate ListItemIcon to emotion #24630
- ListItemSecondaryAction [List] Migrate ListItemSecondaryAction to emotion #24593
- ListItemText [List] Migrate ListItemText to emotion #24602
- ListSubheader [List] Migrate ListSubheader to emotion #24561
- Menu - depends on
MenuList
[Menu] Migrate to emotion #25264 - MenuItem - depends on
ListItem
[Menu] Migrate MenuItem to emotion #24631 -
MenuListNO_NEED_FOR_CONVERSION - MobileStepper [Stepper] Migrate MobileStepper to emotion #25589
- Modal [Modal] Migrate to emotion + unstyled #24857
- NativeSelect - depends on
Input
[Select] Migrate NativeSelect to emotion #24698 -
NoSsrNO_NEED_FOR_CONVERSION - OutlinedInput - depends on
InputBase
[TextField] Migrate OutlinedInput to emotion #24688 - Pagination - depends on
PaginationItem
[Pagination] Migrate Pagination and PaginationItem to emotion #25146 - PaginationItem [Pagination] Migrate Pagination and PaginationItem to emotion #25146
- Paper [Paper] Migrate to emotion #24397
- Popover [Popover] Migrate to emotion #25197
-
PopperNO_NEED_FOR_CONVERSION -
PortalNO_NEED_FOR_CONVERSION - Radio [Radio] Migrate to emotion #25152
- RadioGroup
NO_NEED_FOR_CONVERSION - Rating [Rating] Migrate to emotion #25588
- ScopedCssBaseline [CssBaseline] Migrate ScopedCssBaseline to emotion #25541
- Select - depends on
Input
,NativeSelectInput
,FilledInput
,OutlinedInput
[Select] Migrate to emotion #25653 - Skeleton [Skeleton] Migrate to emotion #24652
-
SlideNO_NEED_FOR_CONVERSION - Slider
- Snackbar - depends on
SnackbarContent
[Snackbar] Migrate to emotion #25142 - SnackbarContent [Snackbar] Migrate SnackbarContent to emotion #25048
- SpeedDial - depends on
Fab
[SpeedDial] Migrate to emotion #25166 - SpeedDialAction - depends on
Tooltip
,Fab
[SpeedDial] Migrate to emotion #25166 - SpeedDialIcon [SpeedDial] Migrate to emotion #25166
- Step [Step] Migrate to emotion #24678
- StepButton - depends on
StepLabel
[Stepper] Migrate StepButton to emotion #25516 - StepConnector [Stepper] Migrate StepConnector to emotion #25092
- StepContent [Stepper] Migrate StepContent to emotion #25210
- StepIcon [Stepper] Migrate StepIcon to emotion #25281
- StepLabel [Stepper] Migrate StepLabel to emotion #25372
- Stepper [Stepper] Migrate Stepper to emotion #25521
- SvgIcon [SvgIcon] Migrate to emotion #24506
-
SwipeableDrawerNO_NEED_FOR_CONVERSION - Switch - depends on
SwitchBase
[Switch] Migrate to emotion #24693 - SwitchBase (internal) [Switch] Migrate SwitchBase to emotion #24552
- Tab [Tab] Migrate TabScrollButton to emotion #24654
- Table [Table] Migrate to emotion #24657
- TableBody [Table] Migrate TableBody to emotion #24703
- TableCell [Table] Migrate TableCell to emotion #24663
- TableContainer [Table] Migrate TableContainer to emotion #24666
- TableFooter [Table] Migrate TableFooter to emotion #24684
- TableHead [Table] Migrate TableHead to emotion #24686
- TablePagination - depends on
Select
,Menuitem
[Table] Migrate TablePagination to emotion #25809 - TableRow [Table] Migrate TableRow to emotion #24687
- TableSortLabel
- Tabs [Tabs] Migrate Tabs to emotion #25824
- TabScrollButton [Tab] Migrate TabScrollButton to emotion #24654
-
TextareaAutosizeNO_NEED_FOR_CONVERSION - TextField [TextField] Migrate to emotion #25286
- ToggleButton [ToggleButton] Migrate to emotion #24674
- ToggleButtonGroup [ToggleButton] Migrate ToggleButtonGroup to emotion #24878
- Toolbar [Toolbar] Migrate to emotion #24567
- Tooltip [Tooltip] Migrate to emotion #24571
- Typography
-
ZoomNO_NEED_FOR_CONVERSION
@material-ui/lab
- YearPicker [DatePicker] Migrate YearPicker to emotion #25928
- PickersYear [DatePicker] Migrate PickersYear to emotion #25949
- TimePickerToolbar [pickers] Migrate TimePickerToolbar to emotion #26274
- PickersDay [pickers] Migrate PickersDay to emotion #25995
- PickersMonth [pickers] Migrate PickersMonth to emotion #26021
- MonthPicker [pickers] Migrate MonthPicker to emotion #26025
- StaticWrapper [pickers] Migrate StaticWrapper to emotion #26275
- PickersPopper [pickers] Migrate PickersPopper to emotion #26391
- PickersToolbar [pickers] Migrate PickersToolbar to emotion #26273
- PickersToolbarText [DateRangePicker] Migrate PickersToolbarText to emotion #25983
- PickersToolbarButton [pickers] Migrate PickersToolbarButton to emotion #25989
- PickersModalDialog [pickers] Migrate PickersModalDialog to emotion #26355
- PickersArrowSwitcher [pickers] Migrate PickersCalendarHeader to emotion #26354
- PickersSlideTransition [pickers] Migrate PickersTransition to emotion #26353
- PickersFadeTransitionGroup [pickers] Migrate PickersTransition to emotion #26353
- PickersCalendar [DateRangePicker] Migrate internal components to emotion #26326
- PickersCalendarHeader [pickers] Migrate PickersCalendarHeader to emotion #26354
- CalendarPickerSkeleton [DatePicker] Migrate CalendarPickerSkeleton to emotion #26335
- CalendarPicker [DatePicker] Migrate CalendarPicker to emotion #26390
- DateTimePickerToolbar [DateTimePicker] Migrate DateTimePickerTabs and Toolbar to emotion #26327
- DateTimerPickerTabs [DateTimePicker] Migrate DateTimePickerTabs and Toolbar to emotion #26327
- DateRangePickerDay [DateRangePicker] Migrate DateRangePickerDay to emotion #26368
- DateRangePickerViewDesktop [DateRangePicker] Migrate internal components to emotion #26326
- DateRangePickerToolbar [DateRangePicker] Migrate internal components to emotion #26326
- DateRangePickerInput [DateRangePicker] Migrate internal components to emotion #26326
- DatePickerToolbar [pickers] Migrate DatePickerToolbar to emotion #26292
- ClockPointer [pickers] Migrate ClockPointer to emotion #26057
- ClockPicker [TimePicker] Migrate ClockPicker to emotion #26389
- ClockNumber [pickers] Migrate ClockNumber to emotion #26058
- Clock [pickers] Migrate Clock to emotion #26278
- LoadingButton [Button] Migrate LoadingButton to emotion #26370
- TreeView [TreeView] Migrate to emotion #25673
- TreeItem [TreeView] Migrate TreeItem to emotion #25835
- Timeline [Timeline] Migrate Timeline to emotion #25838
- TimelineItem [Timeline] Migrate TimelineItem to emotion #25822
- TimelineOppositeContent [Timeline] Migrate TimelineOppositeContent to emotion #25816
- TimelineSeparator [Timeline] Migrate TimelineSeparator to emotion #25666
- TimelineConnector [Timeline] Migrate TimelineConnector to emotion #25663
- TimelineContent [Timeline] Migrate TimelineContent to emotion #25781
- TimelineDot [Timeline] Migrate TimelineDot to emotion #25830
- TabPanel [Tabs] Migrate TabPanel to emotion #25646
-
Unstable_TrapFocusNO_NEED_FOR_CONVERSION
Once the migration of the core components is done, we can then migrate all the demos of the documentation to the sx
prop (preferred) and styled
API, removing all imports of withStyles
and makeStyles
.
Current progress 169/169
Array.from(document.querySelectorAll('.contains-task-list')[2].children)
.concat(Array.from(document.querySelectorAll('.contains-task-list')[3].children)).reduce((acc, item) => {
if (item.querySelector('input[type="checkbox"]:checked')) {
acc.done += 1;
}
acc.total += 1;
return acc;
}, { total: 0, done: 0 });