Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
MIT License
Big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
@material-ui/[email protected]
/@material-ui/[email protected]
sx
(#24211) @mnajdova@material-ui/[email protected]
ClockProps#getClockLabelText
(#24193) @eps1lonBig thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
tabIndex={0}
or customizing the getTabbable
prop.@material-ui/[email protected]
/@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
/@material-ui/[email protected]
Big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
👩🎤 Migrate the Typography to emotion (#23841) @DanailH
This change allows to add typography variants in the theme and to use them directly:
const theme = createMuiTheme({
typography: {
poster: {
color: 'red',
},
},
});
<Typography variant="poster">poster</Typography>;
📚 Add a shortcut to open the Algolia search (#23959) @hmaddisb.
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
/@material-ui/[email protected]
[CssBaseline] Change body font size to body1 (1rem) (#24018) @mbrookes
The new default matches the variant used by the Typography component. To return to the previous size, you can override it in the theme:
const theme = createMuiTheme({
typography: {
body1: {
fontSize: '0.875rem',
},
},
});
@material-ui/[email protected]
/@material-ui/[email protected]
@material-ui/[email protected]
Big thanks to the 24 contributors who made this release possible. Here are some highlights ✨:
@material-ui/[email protected]
[Icon][svgicon] Change default fontSize from default to medium (#23950) @mbrookes
The default value of fontSize
was changed from default
to medium
for consistency.
In the unlikey event that you were using the value default
, the prop can be removed:
-<SvgIcon fontSize="default">{iconPath}</SvgIcon>
+<SvgIcon>{iconPath}</SvgIcon>
[TextField] Add size prop for outlined and filled input (#23832) @mayralgr
Rename marginDense
and inputMarginDense
classes to sizeSmall
and inputSizeSmall
to match the prop.
details
param (#23942) @natac13@material-ui/[email protected]
@material-ui/[email protected]
[system] Move visually hidden helper to utils (#23974) @eps1lon
Only applies if you've installed v5.0.0-alpha.1
-import { visuallyHidden } from '@material-ui/system';
+import { visuallyHidden } from '@material-ui/utils';
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
theme.components
options for the v5 components (#23896) @mnajdovaThis release widens the peer dependency scope of React to accept ^17.0.0 ⚛️ . The change makes it easier for developers to upgrade React independently from Material-UI. The best support for React 17 will be found in Material-UI v5.
This is a reminder that all ongoing work has moved to v5. This means a feature freeze on v4. The development of v4 is limited to important bug fixes, security patches, and easing the upgrade path to v5.
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
Big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
@material-ui/[email protected]
[Box] Remove deprecated props (#23716) @mnajdova
All props are now available under the sx
prop. A deprecation will be landing in v4.
Thanks to @mbrookes developers can automate the migration with a codemod.
-<Box p={2} bgColor="primary.main">
+<Box sx={{ p: 2, bgColor: 'primary.main' }}>
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
/@material-ui/[email protected]
Big thanks to the 12 contributors who made this release possible.
@material-ui/[email protected]
@material-ui/[email protected]
Big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
📚 Improve the IntelliSense support for the sx
prop (#23599) @mnajdova.
You should now get a description for each property of the system. For instance with mx
:
💅 Migrate the first core component to the v5 styling architecture (#23308) @mnajdova.
We have spent the last few months iterating on the new styling approach in the lab, and are confident enough in the new approach to move it to the core, so we have migrated the Slider. We will wait a week or two to collect feedback on it, before scaling it to the rest of the codebase.
📅 Fix the first few issues on the date picker components since the migration in the lab.
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
[Slider] Migrate to emotion (#23308) @mnajdova
By default, emotion injects its style after JSS, this breaks the computed styles. In order to get the correct CSS injection order until all the components are migrated, you need to wrap the root of your application with:
import * as React from 'react';
import ReactDOM from 'react-dom';
import { StylesProvider } from '@material-ui/core';
import App from './App';
ReactDOM.render(
<StylesProvider injectFirst>
<App />
</StylesProvider>,
document.querySelector('#root'),
);
This enforces emotion being injected first. More details in the documentation.
[Autocomplete] Rename closeIcon
prop with clearIcon
to avoid confusion (#23617) @akhilmhdh.
-<Autocomplete closeIcon={icon} />
+<Autocomplete clearIcon={icon} />
[Dialog] Remove the disableBackdropClick
prop. It's redundant with the reason
argument (#23607) @eps1lon.
<Dialog
- disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+ if (reason !== 'backdropClick') {
+ onClose(event, reason);
+ }
+ }}
/>
[Modal] Remove the disableBackdropClick
prop. It's redundant with the reason
argument (#23607) @eps1lon.
<Modal
- disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+ if (reason !== 'backdropClick') {
+ onClose(event, reason);
+ }
+ }}
/>
[Modal] Remove the onEscapeKeyDown
prop. It's redundant with the reason
argument. (#23571) @eps1lon
<Modal
- onEscapeKeyDown={handleEscapeKeyDown}
+ onClose={(event, reason) => {
+ if (reason === "escapeKeyDown") {
+ handleEscapeKeyDown(event);
+ }
+ }}
/>;
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
sx
prop IntelliSense (#23599) @mnajdova@material-ui/[email protected]
@material-ui/[email protected]
[DatePicker] Change the import path of the date adapters (#23568) @eps1lon.
It better fits with the current import convention.
-import AdapterDateFns from '@material-ui/lab/dateAdapter/date-fns';
+import AdapterDateFns from '@material-ui/lab/AdapterDateFns';
Big thanks to the 34 contributors who made this release possible. Here are some highlights ✨:
📅 Migrate the date picker to the lab (#22692) @dmtrKovalenko.
We have integrated the components with the code infrastructure. Next, we will migrate all the GitHub issues from material-ui-pickers and archive the repository. This migration will help provide first-class support for the date picker components. The component will stay in the lab as long as necessary to reach the high-quality bar we have for core components. You can find the new documentation here.
While the source code is currently hosted in the main repository, we might move it to the x repository in the future, depending on what is easier for the commercial date range picker. The date picker will stay open source no matter what.
📚 Revamp the documentation for the system. The System contains CSS utilities. The documentation now promotes the use of the sx
prop. It's ideal for adding one-off styles, e.g. padding, but when pushed to its limits, it can be used to implement quickly a complete page.
👩🎨 Upgrade emotion to v11 (#23007) @mnajdova.
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
[TextField] Change default variant from standard to outlined (#23503) @mbrookes
Standard has been removed from the Material Design guidelines. This codemod will automatically update your code.
-<TextField value="Standard" />
-<TextField value="Outlined" variant="outlined" />
+<TextField value="Standard" variant="standard" />
+<TextField value="Outlined" />
[Autocomplete] Remove debug
in favor of open
and dev tools (#23377) @eps1lon
There are a couple of simpler alternatives: open={true}
, Chrome devtools "Emulate focused", or React devtools props.
disablePortal
(#23263) @eps1lon@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
Big thanks to the 20 contributors who made this release possible. Here are some highlights ✨:
⚛️ Add support for React 17 (#23311) @eps1lon.
React 17 release is unusual because it doesn't add any new developer-facing features. It was released a couple of days ago. You can learn more about it in the introduction post. Material-UI now supports ^16.8.0 || ^17.0.0
.
🛠 Introduce a new @material-ui/unstyled
package (#23270) @mnajdova.
This package will host the unstyled version of the components. In this first iteration, only the Slider is available. You can find it documented under the same page as the styled version.
Why an unstyled package?
While engineering teams are successfully building custom design systems by wrapping Material-UI, we occasionally hear that Material Design or our styling solution are something they don't need. Some teams prefer SASS, others prefer to customize the components starting from a pristine state. What all these teams have in common is that they value the features coming from the components, such as accessibility.
The unstyled package goes one step down in the abstraction layer, providing more flexibility. Angular Material introduced this approach two years ago. Today their unstyled components account for 25% of the usage.
Another reason for introducing this package is to prepare the groundwork for a second theme (not Material Design based).
A note on the terminology: "unstyled" means that the components have the same API as the "styled" components but come without CSS. Material-UI also contains "headless" components that exposes a hook API, e.g. useAutocomplete or usePagination.
This change is part of our strategy to iterate on the v5 architecture with the Slider
first. In the next alpha release, we plan to replace the v4 slider with the v5 slider. Once the new approach is stress-tested and validated, we will roll it out to all the components.
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
[AppBar] Fix z-index when position="static" (#23325) @sujinleeme
Remove z-index when position static and relative
[theme] Fix error message for augmentColor failure (#23371) @reedanders
The signature of theme.palette.augmentColor
helper has changed:
-theme.palette.augmentColor(red);
+theme.palette.augmentColor({ color: red, name: 'brand' });
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
README.md
(#23329) @mtsknnBig thanks to the 23 contributors who made this release possible. Here are some highlights ✨:
💄 Introduce a new sx
prop (#23053, #23205) @mnajdova
We have resumed the work on Material-UI System. This is made possible by the latest progress on the new styling solution of v5.
You can read the introduction blog post that we did for the system two years ago.
The system is meant to solve the following problems:
styled()
API.makeStyles
for the first time in a component is daunting. For example, it's why this VS Code plugin exists. What if we had less code to type, gaining velocity when writing styles?This new iteration of the system brings two major improvements:
It moves from the support of a subset of CSS to the support of a superset of CSS.
Learning the shorthand is optional. It's no longer necessary to moving back to styled() when the system doesn't support a specific CSS property.
It moves from support on Box only to any core component (starting with the slider).
import Slider from '@material-ui/lab/SliderStyled';
// Set the primary color and a vertical margin of 16px on desktop.
<Slider sx={{ color: 'primary.main', my: { xs: 0, md: 2 } }} />;
✨ Upgrade Popper.js from v1 to v2 (#21761) @joshwooding
The change reduces the bundle size (-1 kB gzipped) while fixing bugs at the same time.
🐛 Fix broken nested imports with the icons package (#23157) @eps1lon
The revamp of the bundling strategy in #22814 has broken the nested imports.
Imports such as the one below should work again with this release:
import CloseIcon from '@material-ui/icons/Close';
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
[Popper] Upgrade to popper.js to v2 (#21761) @joshwooding
This third-party library has introduced a lot of changes.
You can read their migration guide or the following summary:
The CSS prefixes have changed:
popper: {
zIndex: 1,
- '&[x-placement*="bottom"] $arrow': {
+ '&[data-popper-placement*="bottom"] $arrow': {
Method names have changed.
-popperRef.current.scheduleUpdate()
+popperRef.current.update()
-popperRef.current.update()
+popperRef.current.forceUpdate()
Modifiers' API has changed a lot. There are too many changes to be covered here.
[withMobileDialog] Remove this higher-order component (#23202) @RDIL
The hook API allows a simpler and more flexible solution than the HOC:
-import withMobileDialog from '@material-ui/core/withMobileDialog';
+import { useTheme, useMediaQuery } from '@material-ui/core';
function ResponsiveDialog(props) {
- const { fullScreen } = props;
+ const theme = useTheme();
+ const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
const [open, setOpen] = React.useState(false);
// ...
-export default withMobileDialog()(ResponsiveDialog);
+export default ResponsiveDialog;
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
[AvatarGroup] Move from lab to core (#23121) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import AvatarGroup from '@material-ui/lab/AvatarGroup';
+import AvatarGroup from '@material-ui/core/AvatarGroup';
@material-ui/[email protected]
@material-ui/[email protected]
extendedIcon
(#23160) @MatejKastakBig thanks to the 25 contributors who made this release possible.
Here are some highlights ✨:
📦 Ship modern bundle (#22814) @eps1lon.
This is a significant update to the browsers supported by Material-UI.
The previous policy was defined 2 years ago, and the landscape has evolved since then. The package now includes 4 bundles:
stable
(default, formerly esm
) which targets a snapshot (on release) of > 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11"
node
(formerly default) which targets a snapshot (on release) of maintained node versions
legacy
(new) which is stable
+ IE11modern
(formerly es
) which targets the last 1 version of evergreen browsers and active node (currently that is 14The change yields a 6% reduction in bundle size 📦 (Babel only).
In the coming weeks, we will refactor the internals to take advantage of the new browser capabilities that dropping these older platforms allows. For instance, we might be able to remove the span we render inside the <Button>
to work around Flexbug #9.
Check the updated Supported platforms documentation and new "minimizing bundle size" guide.
If you target IE11, you need to use the new bundle (legacy
). We are treating IE11 as a second class-citizen, which is a continuation of the direction taken in #22873.
🚀 Improve the internal benchmark suite (#22923, #23058) @mnajdova.
This was a prerequisite step to improve the system. We needed to be able to measure performance. After #22945, we have measured that the Box
component is x3 faster in v5-alpha compared to v4.
✏️ A new blog post: Q3 2020 Update (#23055) @oliviertassinari.
🐙 Migrate more tests to react-testing-library @deiga, @Morteza-Jenabzadeh, @nicholas-l.
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
@material-ui/[email protected]
alpha
color utility instead of deprecated fade
(#22978) @joshwooding@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
Big thanks to the 45 contributors who made this release possible.
Here are some highlights ✨:
Box
component from JSS to @material-ui/styled-engine (use emotion by default) (#22945) @mnajdova.@material-ui/[email protected]
[Accordion] Remove display:flex
from AccordionDetails (#22809) @croraf
The style was too opinionated. Most developers expect display: block
.
[Accordion] Replace IconButton wrapper with div (#22817) @croraf
Remove IconButtonProps prop from AccordionSummary.
The component renders a <div>
element instead of an IconButton.
The prop is no longer relevant.
[Box] Add mui styled usage (#22945) @mnajdova
Change the style-engine powering the Box component from JSS to the style engine adatper (emotion by default).
[CircularProgress] Drop IE11 wobbly workaround (#22873) @suliskh
The IE11 workaround is harming performance on the latest browsers.
This change is part of a best-effort strategy to keep IE11 support.
We are degrading the UX and DX with IE11 where we can improve the components on modern browsers.
[Table] Rename onChangeRowsPerPage and onChangePage (#22900) @eladmotola
The change was done to match the API convention.
<TablePagination
- onChangeRowsPerPage={()=>{}}
- onChangePage={()=>{}}
+ onRowsPerPageChange={()=>{}}
+ onPageChange={()=>{}}
[theme] Rename fade to alpha (#22834) @mnajdova
Better describe its functionality. The previous name was leading to confusion when the input color already had an alpha value. The helper overrides the alpha value of the color.
- import { fade } from '@material-ui/core/styles';
+ import { alpha } from '@material-ui/core/styles';
const classes = makeStyles(theme => ({
- backgroundColor: fade(theme.palette.primary.main, theme.palette.action.selectedOpacity),
+ backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
}));
[Tooltip] Make interactive
default (#22382) @eps1lon
The previous default behavior failed success criterion 1.4.3 ("hoverable") in WCAG 2.1.
To reflect the new default value, the prop was renamed to disableInteractive
.
If you want to restore the old behavior (thus not reaching level AA), you can apply the following diff:
-<Tooltip>
+<Tooltip disableInteractive>
# Interactive tooltips no longer need the `interactive` prop.
-<Tooltip interactive>
+<Tooltip>
renderInput
(#22789) @eps1lonref
(#22927) @lcswillemsfollowCursor
(#22876) @xtrixia@material-ui/[email protected]
@material-ui/[email protected]
[Autocomplete] Move from lab to core (#22715) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import Autocomplete from '@material-ui/lab/Autocomplete';
-import useAutocomplete from '@material-ui/lab/useAutocomplete';
+import Autocomplete from '@material-ui/core/Autocomplete';
+import useAutocomplete from '@material-ui/core/useAutocomplete';
[Pagination] Move from lab to core (#22848) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import Pagination from '@material-ui/lab/Pagination';
-import PaginationItem from '@material-ui/lab/PaginationItem';
-import { usePagination } from '@material-ui/lab/Pagination';
+import Pagination from '@material-ui/core/Pagination';
+import PaginationItem from '@material-ui/core/PaginationItem';
+import usePagination from '@material-ui/core/usePagination';
[SpeedDial] Move from lab to core (#22743) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import SpeedDial from '@material-ui/lab/SpeedDial';
-import SpeedDialAction from '@material-ui/lab/SpeedDialAction';
-import SpeedDialIcon from '@material-ui/lab/SpeedDialIcon';
+import SpeedDial from '@material-ui/core/SpeedDial';
+import SpeedDialAction from '@material-ui/core/SpeedDialAction';
+import SpeedDialIcon from '@material-ui/core/SpeedDialIcon';
[ToggleButton] Move from lab to core (#22784) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import ToggleButton from '@material-ui/lab/ToggleButton';
-import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
+import ToggleButton from '@material-ui/core/ToggleButton';
+import ToggleButtonGroup from '@material-ui/core/ToggleButtonGroup';
[TreeView] Improve customization of tree item (#22846) @joshwooding
Remove onLabelClick
and onIconClick
.
yarn mocha
(#22899) @eps1lonBig thanks to the 29 contributors who made this release possible.
Here are some highlights ✨:
👩🎨 A first iteration on the new styling solution. @mnajdova
You can find a new version of the slider in the lab powered by emotion.
In the event that you are already using styled-components in your application, you can swap emotion for styled-components 💅. Check this CodeSandbox for a demo. It relies on aliases to prevent any bundle size overhead.
The new styling solution saves 2kB gzipped in the bundle compared to JSS, and about 14 kB gzipped if you were already using emotion or styled-components.
Last but not least, the change allows us to take advantage of dynamic style props. We will use them for dynamic color props, variant props, and new style props (an improved system).
This change has been in our roadmap for more than a year.
We announced it in the v4 release blog post as a direction v5 would take.
🛠 A first iteration on the unstyled components. @mnajdova
You can find a new version of the slider in the lab without any styles.
The unstyled component weighs 6.5 kB gzipped, compared with 26 kB for the styled version when used standalone. The component is best suited for use when you want to fully customize the look of the component without reimplementing the JavaScript and accessibility logic.
⚡️ A first alpha of the DataGrid component. @dtassone
It has taken 6 months of development since the initial commit (March 15th, 2020) to make the first alpha release of the grid. The component comes in two versions:
@material-ui/data-grid is licensed under MIT, while @material-ui/x-grid is licensed under a commercial license.
🪓 Keep working on the breaking changes. @mbrookes
We aim to complete most of the breaking changes during the alpha stage of v5.
We will move to beta once all the breaking changes we have anticipated are handled.
As always, you should find a clear and simple upgrade path for each of them.
You can learn more about the breaking changes left to be done in #22700.
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
[Chip] Rename default
variant to filled
(#22683) @mnajdova
Rename default
variant to filled
for consistency.
-<Chip variant="default">
+<Chip variant="filled">
[Tabs] Add allowScrollButtonsMobile prop for mobile view (#22700) @GauravKesarwani
The API that controls the scroll buttons has been split it into two props:
scrollButtons
prop controls when the scroll buttons are displayed depending on the space available.allowScrollButtonsMobile
prop removes the CSS media query that systematically hides the scroll buttons on mobile.-<Tabs scrollButtons="on" />
-<Tabs scrollButtons="desktop" />
-<Tabs scrollButtons="off" />
+<Tabs scrollButtons allowScrollButtonsMobile />
+<Tabs scrollButtons />
+<Tabs scrollButtons={false} />
[theme] Improve breakpoints definitions (#22695) @mnajdova
Breakpoints are now treated as values instead of ranges.
The behavior of down(key)
was changed to define media query less than the value defined with the corresponding breakpoint (exclusive).
The behavior of between(start, end)
was also updated to define media query for the values between the actual values of start (inclusive) and end (exclusive).
Find examples of the changes required defined below:
-theme.breakpoints.down('sm') // '@media (max-width:959.95px)' - [0, sm + 1) => [0, md)
+theme.breakpoints.down('md') // '@media (max-width:959.95px)' - [0, md)
-theme.breakpoints.between('sm', 'md') // '@media (min-width:600px) and (max-width:1279.95px)' - [sm, md + 1) => [sm, lg)
+theme.breakpoints.between('sm', 'lg') // '@media (min-width:600px) and (max-width:1279.95px)' - [sm, lg)
[theme] Rename type
to mode
(#22687) @mnajdova
Renames theme.palette.type
to theme.palette.mode
, to better follow the "dark mode" term that is usually used for describing this feature.
import { createMuiTheme } from '@material-ui/core/styles';
-const theme = createMuitheme({palette: { type: 'dark' }}),
+const theme = createMuitheme({palette: { mode: 'dark' }}),
The changes are supported by the adaptV4Theme()
for easing the migration
@material-ui/[email protected]
[Alert] Move from lab to core (#22651) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import Alert from '@material-ui/lab/Alert';
-import AlertTitle from '@material-ui/lab/AlertTitle';
+import Alert from '@material-ui/core/Alert';
+import AlertTitle from '@material-ui/core/AlertTitle';
[Rating] Move from lab to core (#22725) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import Rating from '@material-ui/lab/Rating';
+import Rating from '@material-ui/core/Rating';
[Skeleton] Move from lab to core (#22740) @mbrookes
Move the component from the lab to the core. This component will become stable.
-import Skeleton from '@material-ui/lab/Skeleton';
+import Skeleton from '@material-ui/core/Skeleton';
[Autocomplete] Get root elements of options via renderOption (#22591) @ImanMahmoudinasab
After this change, the full DOM structure of the option is exposed.
It makes customizations easier.
You can recover from the change with:
<Autocomplete
- renderOption={(option, { selected }) => (
- <React.Fragment>
+ renderOption={(props, option, { selected }) => (
+ <li {...props}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
style={{ marginRight: 8 }}
checked={selected}
/>
{option.title}
- </React.Fragment>
+ </li>
)}
/>
@material-ui/[email protected]
The new default style engine leveraging emotion.
@material-ui/[email protected]
Allows developer to swap emotion with styled-components.
More documentation are coming.
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
Big thanks to the 16 contributors who made this release possible.
Here are some highlights ✨:
@material-ui/[email protected]
[Accordion] Normalize focusVisible logic (#22567) @oliviertassinari
Rename focused
to focusVisible
for consistency with the other components:
<Accordion
classes={{
- focused: 'custom-focus-visible-classname',
+ focusVisible: 'custom-focus-visible-classname',
}}
/>
[Stepper] Remove Paper and built-in padding (#22564) @mbrookes
The root component (Paper) was replaced with a <div>
. Stepper no longer has elevation, nor inherits Paper's props. This change is meant to encourage composition.
-<Stepper elevation={2}>
- <Step>
- <StepLabel>Hello world</StepLabel>
- </Step>
-</Stepper>
+<Paper square elevation={2}>
+ <Stepper>
+ <Step>
+ <StepLabel>Hello world</StepLabel>
+ </Step>
+ </Stepper>
+<Paper>
Remove the built-in 24px padding for consistency with the other components that avoid reserving space anytime it's possible.
-<Stepper>
- <Step>
- <StepLabel>Hello world</StepLabel>
- </Step>
-</Stepper>
+<Stepper style={{ padding: 24 }}>
+ <Step>
+ <StepLabel>Hello world</StepLabel>
+ </Step>
+</Stepper>
[theme] Always return default spacing value with px units (#22552) @mbrookes
theme.spacing
now returns single values with px units by default.
This change improves the integration with styled-components & emotion (with the CSS template strings syntax).
Before:
theme.spacing(2) => 16
After:
theme.spacing(2) => '16px'
You can restore the previous behavior with:
-const theme = createMuiTheme();
+const theme = createMuiTheme({
+ spacing: x => x * 8,
+});
[theme] Remove palette.text.hint key (#22537) @mbrookes
The theme.palette.text.hint
key was available but unused in Material-UI v4 components.
You can use adaptV4Theme()
to restore the previous behavior.
@material-ui/[email protected]
[Rating] Use different shape for empty and filled icons (#22554) @oliviertassinari
Change the default empty icon to improve accessibility (1.4.1 WCAG 2.1).
If you have a custom icon
prop but no emptyIcon
prop, you can restore the previous behavior with:
<Rating
icon={customIcon}
+ emptyIcon={null}
/>
Big thanks to the 14 contributors who made this release possible.
Here are some highlights ✨:
@material-ui/[email protected]
onRendered
prop from Modal and Portal (#22464) @eps1lon@material-ui/[email protected]
Big thanks to the 19 contributors who made this release possible.
Here are some highlights ✨:
const theme = createMuiTheme({
components: {
MuiIconButton: {
defaultProps: {
size: 'small',
},
styleOverrides: {
sizeSmall: {
marginLeft: 4,
marginRight: 4,
padding: 12,
},
},
},
},
});
✨ Add text in divider support (#22285) @ShehryarShoukat96
<Divider>{'CENTER'}</Divider>
♿️ A bunch of accessibility fixes (#22366, #22374, #22377, #22340, #22376) @fakeharahman @alexmotoc @eps1lon @oliviertassinari
⚛️ Increase adoption of TypeScript in the codebase (#22389, #22367, #22282) @Luchanso, @oliviertassinari
And many more 🐛 bug fixes and 📚 improvements.
@material-ui/[email protected]
[theme] Rename theme keys to defaultProps and styleOverrides (#22347) @mnajdova
[theme] Restructure component definitions (#22293) @mnajdova
The components' definition inside the theme were restructure under the components
key, to allow people easier discoverability about the definitions regarding one component.
props
import { createMuiTheme } from '@material-ui/core/styles';
const theme = createMuitheme({
- props: {
- MuiButton: {
- disableRipple: true,
- },
- },
+ components: {
+ MuiButton: {
+ defaultProps: {
+ disableRipple: true,
+ },
+ },
+ },
});
overrides
import { createMuiTheme } from '@material-ui/core/styles';
const theme = createMuitheme({
- overrides: {
- MuiButton: {
- root: { padding: 0 },
- },
- },
+ components: {
+ MuiButton: {
+ styleOverrides: {
+ root: { padding: 0 },
+ },
+ },
+ },
});
Note that if you don't have the time to upgrade the structure of the theme, you
can use the adaptV4Theme()
adapter.
[GridList] Rename to ImageList (#22311) @mbrookes
[GridList] Rename Tile to Item (#22385) @mbrookes
Rename the GridList
components to ImageList
to align with the current Material Design naming.
-import GridList from '@material-ui/core/GridList';
-import GridListTile from '@material-ui/core/GridListTile';
-import GridListTileBar from '@material-ui/core/GridListTileBar';
+import ImageList from '@material-ui/core/ImageList';
+import ImageListItem from '@material-ui/core/ImageListItem';
+import ImageListItemBar from '@material-ui/core/ImageListItemBar';
-<GridList>
- <GridListTile>
+<ImageList>
+ <ImageListItem>
<img src="file.jpg" alt="Image title" />
- <GridListTileBar
+ <ImageListItemBar
title="Title"
subtitle="Subtitle"
/>
- </GridListTile>
-</GridList>
+ </ImageListItem>
+</ImageList>
@material-ui/[email protected]
classes
prop (#22312) @eps1lon@material-ui/[email protected]
@material-ui/[email protected]
classes
prop (#22312) @eps1lon@types/yargs
(#22339) @eps1lonBig thanks to the 22 contributors who made this release possible. Here are some highlights ✨:
@material-ui/[email protected]
[Menu] Remove transition onX props (#22212) @mbrookes
The onE* transition props were removed. Use TransitionProps instead.
<Menu
- onEnter={onEnter}
- onEntered={onEntered},
- onEntering={onEntered},
- onExit={onEntered},
- onExited={onEntered},
- onExiting={onEntered}
+ TransitionProps={{
+ onEnter,
+ onEntered,
+ onEntering,
+ onExit,
+ onExited,
+ onExiting,
+ }}
>
[Popover] Remove transition onX props (#22184) @mbrookes
The onE* transition props were removed. Use TransitionProps instead.
<Popover
- onEnter={onEnter}
- onEntered={onEntered},
- onEntering={onEntered},
- onExit={onEntered},
- onExited={onEntered},
- onExiting={onEntered}
+ TransitionProps={{
+ onEnter,
+ onEntered,
+ onEntering,
+ onExit,
+ onExited,
+ onExiting,
+ }}
/>
[TextField] Improve line-height reset (#22149) @imnasnainaec
Increase the line-height by 4px to support long descender on special alphabets.
If you were overriding the input vertical padding, reduce it by 4px.
@material-ui/[email protected]
@material-ui/[email protected]
@material-ui/[email protected]
@global
being considered a class (#22297) @eps1lonBig thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
💅 Introduce a new dynamic variant API (#21648) @mnajdova.
This API allows developers to add new variants on the Material-UI's components right from the theme, without having to wrap the components.
For instance with the Button:
// Define the style that should be applied, for specific props.
const theme = createMuiTheme({
variants: {
MuiButton: [
{
props: { variant: 'dashed', color: 'secondary' },
styles: {
border: `4px dashed ${red[500]}`,
},
},
],
},
});
// Retain type safety.
declare module '@material-ui/core/Button/Button' {
interface ButtonPropsVariantOverrides {
dashed: true;
}
}
// Enjoy!
<Button variant="dashed" />
More details in the documentation and RFC.
👮 Add documentation for the TrapFocus component (#22062) @oliviertassinari.
⚛️ Prepare support for React v17 (#22093, #22105, #22143, #22111) @eps1lon.
🚧 We have undertaken breaking changes.
@material-ui/[email protected]
[Avatar] Rename variant circle -> circular for consistency (#22015) @kodai3
Rename circle
to circular
for consistency. The possible values should be adjectives, not nouns:
-<Avatar variant="circle">
+<Avatar variant="circular">
[Badge] Rename overlap circle -> circular and rectangle -> rectangular for consistency (#22050) @kodai3
Rename circle
to circular
and rectangle
to rectangular
for consistency. The possible values should be adjectives, not nouns:
-<Badge overlap="circle">
-<Badge overlap="rectangle">
+<Badge overlap="circular">
+<Badge overlap="rectangular">
[CircularProgress] Remove static variant, simplify determinate (#22060) @mbrookes
The static
variant has been merged into the determinate
variant, with the latter assuming the appearance of the former.
The removed variant was rarely useful. It was an exception to Material Design, and was removed from the specification.
-<CircularProgress variant="determinate" />
-<CircularProgress variant="static" classes={{ static: 'className' }} />
+<CircularProgress variant="determinate" classes={{ determinate: 'className' }} />
[Dialog] Remove transition onX props (#22113) @mbrookes
The onE* transition props were removed. Use TransitionProps instead.
<Dialog
- onEnter={onEnter}
- onEntered={onEntered},
- onEntering={onEntered},
- onExit={onEntered},
- onExited={onEntered},
- onExiting={onEntered}
+ TransitionProps={{
+ onEnter,
+ onEntered,
+ onEntering,
+ onExit,
+ onExited,
+ onExiting,
+ }}
/>
[Fab] Rename round -> circular for consistency (#21903) @kodai3
Rename round
to circular
for consistency. The possible values should be adjectives, not nouns:
-<Fab variant="round">
+<Fab variant="circular">
[List] Improve hover/select/focus UI display (#21930) @joshwooding
[Pagination] Rename round -> circular for consistency (#22009) @kodai3
Rename round
to circular
for consistency. The possible values should be adjectives, not nouns:
-<Pagination shape="round">
-<PaginationItem shape="round">
+<Pagination shape="circular">
+<PaginationItem shape="circular">
[RootRef] Remove component (#21974) @eps1lon
This component was removed. You can get a reference to the underlying DOM node of our components via ref
prop.
The component relied on ReactDOM.findDOMNode
which is deprecated in React.StrictMode
.
-<RootRef rootRef={ref}>
- <Button />
-</RootRef>
+<Button ref={ref} />
[Snackbar] Change the default position on desktop (#21980) @kodai3
The notification now displays at the bottom left on large screens.
It better matches the behavior of Gmail, Google Keep, material.io, etc.
You can restore the previous behavior with:
-<Snackbar />
+<Snackbar anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} />
[Snackbar] Remove transition onX props (#22107) @mbrookes
The onE* transition props were removed. Use TransitionProps instead.
<Snackbar
- onEnter={onEnter}
- onEntered={onEntered},
- onEntering={onEntered},
- onExit={onEntered},
- onExited={onEntered},
- onExiting={onEntered}
+ TransitionProps={{
+ onEnter,
+ onEntered,
+ onEntering,
+ onExit,
+ onExited,
+ onExiting,
+ }}
/>
[TextareaAutosize] Rename rowsMax->maxRows & rowsMin->minRows (#21873) @mhayk
Rename rowsMin
/rowsMax
prop with mi Rows
/maxRows
for consistency with HTML attributes.
-<TextField rowsMax={6}>
-<TextareAutosize rowsMin={1}>
-<TextareAutosize rowsMax={6}>
+<TextField maxRows={6}>
+<TextareAutosize minRows={1}>
+<TextareAutosize maxRows={6}>
[TextField] Better isolate static textarea behavior to dynamic one (#21995) @AxartInc
Better isolate the fixed textarea height behavior to the dynamic one.
You need to use the rowsMin
prop in the following case:
-<TextField rows={2} rowsMax={5} />
+<TextField rowsMin={2} rowsMax={5} />
Remove the rows
prop, use the rowsMin
prop instead.
This change aims to clarify the behavior of the prop.
-<TextareaAutosize rows={2} />
+<TextareaAutosize rowsMin={2} />
[theme] Remove theme.mixins.gutters (#22109) @joshwooding
The abstraction hasn't proven to be used frequently enough to be valuable.
-theme.mixins.gutters(),
+paddingLeft: theme.spacing(2),
+paddingRight: theme.spacing(2),
+[theme.breakpoints.up('sm')]: {
+ paddingLeft: theme.spacing(3),
+ paddingRight: theme.spacing(3),
+},
@material-ui/[email protected]
[Skeleton] Rename variant circle -> circular and rect -> rectangular for consistency (#22053) @kodai3
Rename circle
to circular
and rect
to rectangular
for consistency. The possible values should be adjectives, not nouns:
-<Skeleton variant="circle">
-<Skeleton variant="rect">
+<Skeleton variant="circular">
+<Skeleton variant="rectangular">
@material-ui/[email protected]
import * as React from 'react';
(#22058) @mbrookesBig thanks to the 18 contributors who made this release possible.
@material-ui/[email protected]
[Grid] Rename justify prop to justifyContent (#21845) @mnajdova
Rename justify
prop with justifyContent
to be aligned with the CSS property name.
-<Grid justify="center">
+<Grid justifyContent="center">
index
public in the ValueLabel props (#21932) @govardhan-srinivas@material-ui/[email protected]
typescript-to-proptypes-ignore
directives (#21867) @eps1lon