Migrate all components to emotion
See original GitHub issueAs decided in https://github.com/mui-org/material-ui/issues/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 https://github.com/mui-org/material-ui/pull/24518
- AccordionActions #24538
- AccordionDetails #24539
- AccordionSummary #24540
- Alert #24442
- AlertTitle #24448
- AppBar https://github.com/mui-org/material-ui/pull/24439
- Autocomplete - depends on
ListSubheader
,Chip
#24696 - Avatar
- AvatarGroup #24452
- Backdrop #24523
- Badge
- BottomNavigation #24556
- BottomNavigationAction #24556
- Box
- Breadcrumbs #24522
- Button
- ButtonBase
- ButtonGroup #24775
- Card #24597
- CardActionArea #24636
- CardActions #24604
- CardContent #24600
- CardHeader #24626
- CardMedia #24625
- Checkbox - depends on
SwitchBase
#24702 - Chip #24649
- CircularProgress #24622
- ~ClickAwayListener~ NO_NEED_FOR_CONVERSION
- Collapse #24501
- Container
- CssBaseline
- Dialog #25216
- DialogActions #24613
- DialogContent #24670
- DialogContentText #25267
- DialogTitle #24623
- Divider #24558
- Drawer - depends on
Modal
#25091 - Fab #24618
- ~Fade~ NO_NEED_FOR_CONVERSION
- FilledInput - depends on
InputBase
#24634 - FormControl #24659
- FormControlLabel #25007
- FormGroup #24685
- FormHelperText #24661
- FormLabel #24665
- GlobalStyles
- Grid #24395
- ~Grow~ NO_NEED_FOR_CONVERSION
- Hidden #24544
- Icon #24516
- IconButton #24542
- ImageList #24615
- ImageListItem #24619
- ImageListItemBar #24632
- Input - depends on
InputBase
#24638 - InputAdornment #25279
- InputBase #24555
- InputLabel - depends on
FormLabel
#24665 - LinearProgress
- Link #24529
- List #24560
- ListItem #24543
- ListItemAvatar #24656
- ListItemIcon #24630
- ListItemSecondaryAction #24593
- ListItemText #24602
- ListSubheader #24561
- Menu - depends on
MenuList
#25264 - MenuItem - depends on
ListItem
#24631 - ~MenuList~ NO_NEED_FOR_CONVERSION
- MobileStepper #25589
- Modal #24857
- NativeSelect - depends on
Input
#24698 - ~NoSsr~ NO_NEED_FOR_CONVERSION
- OutlinedInput - depends on
InputBase
#24688 - Pagination - depends on
PaginationItem
#25146 - PaginationItem #25146
- Paper #24397
- Popover #25197
- ~Popper~ NO_NEED_FOR_CONVERSION
- ~Portal~ NO_NEED_FOR_CONVERSION
- Radio #25152
- RadioGroup ~NO_NEED_FOR_CONVERSION~
- Rating #25588
- ScopedCssBaseline #25541
- Select - depends on
Input
,NativeSelectInput
,FilledInput
,OutlinedInput
#25653 - Skeleton #24652
- ~Slide~ NO_NEED_FOR_CONVERSION
- Slider
- Snackbar - depends on
SnackbarContent
#25142 - SnackbarContent #25048
- SpeedDial - depends on
Fab
#25166 - SpeedDialAction - depends on
Tooltip
,Fab
#25166 - SpeedDialIcon #25166
- Step #24678
- StepButton - depends on
StepLabel
#25516 - StepConnector #25092
- StepContent #25210
- StepIcon #25281
- StepLabel #25372
- Stepper #25521
- SvgIcon #24506
- ~SwipeableDrawer~ NO_NEED_FOR_CONVERSION
- Switch - depends on
SwitchBase
#24693 - SwitchBase (internal) #24552
- Tab #24654
- Table #24657
- TableBody #24703
- TableCell #24663
- TableContainer #24666
- TableFooter #24684
- TableHead #24686
- TablePagination - depends on
Select
,Menuitem
#25809 - TableRow #24687
- TableSortLabel
- Tabs #25824
- TabScrollButton #24654
- ~TextareaAutosize~ NO_NEED_FOR_CONVERSION
- TextField #25286
- ToggleButton #24674
- ToggleButtonGroup #24878
- Toolbar #24567
- Tooltip #24571
- Typography
- ~Zoom~ NO_NEED_FOR_CONVERSION
@material-ui/lab
- YearPicker #25928
- PickersYear #25949
- TimePickerToolbar #26274
- PickersDay #25995
- PickersMonth #26021
- MonthPicker #26025
- StaticWrapper #26275
- PickersPopper #26391
- PickersToolbar #26273
- PickersToolbarText #25983
- PickersToolbarButton #25989
- PickersModalDialog #26355
- PickersArrowSwitcher #26354
- PickersSlideTransition #26353
- PickersFadeTransitionGroup #26353
- PickersCalendar #26326
- PickersCalendarHeader #26354
- CalendarPickerSkeleton #26335
- CalendarPicker #26390
- DateTimePickerToolbar #26327
- DateTimerPickerTabs #26327
- DateRangePickerDay #26368
- DateRangePickerViewDesktop #26326
- DateRangePickerToolbar #26326
- DateRangePickerInput #26326
- DatePickerToolbar #26292
- ClockPointer #26057
- ClockPicker #26389
- ClockNumber #26058
- Clock #26278
- LoadingButton #26370
- TreeView #25673
- TreeItem #25835
- Timeline #25838
- TimelineItem #25822
- TimelineOppositeContent #25816
- TimelineSeparator #25666
- TimelineConnector #25663
- TimelineContent #25781
- TimelineDot #25830
- TabPanel #25646
- ~Unstable_TrapFocus~ NO_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 });
Issue Analytics
- State:
- Created 3 years ago
- Reactions:106
- Comments:74 (65 by maintainers)
Top GitHub Comments
I have removed the “On hold” label as @mnajdova is back. We should have bandwidth now to get to 100% 🔥
Well done everybody in the migration! 👏