Description
Material UI Image is a React component for showing images in the Material-UI style. It is used like a regular img tag, but while the picture loads it shows a loading spinner, and once the image arrives it fades in over a set duration. Its properties include animationDuration, which defaults to 3000 milliseconds, an aspectRatio that defaults to 1/1, and a cover option that switches the image to object-fit cover. You can change the background colour, hide the error icon or the spinner, replace the loading component or the error icon, and style the image and its container separately. Any other props are passed through to the underlying img element. The README notes that this version targets Material-UI 1.0.0-rc.0 or later and links to a legacy version for Material-UI 0.x. Installation is a single npm command, and the component is used with its src prop.…
Highlights
- Fades images in as they load
- Loading spinner and error icon
- Aspect ratio and cover options
- Custom loading and error components
- Passes other props to the img element
Ratings & Reviews
No ratings yet
Be the first to rate material-ui-image.
People also visit

react-lazy-load-image-component
React Component to lazy load images using a HOC to track window scroll position
material-ui-image FAQ
What does Material UI Image do?
It shows an image with a loading spinner and fades it in once it has loaded. You use it like an img tag.
Which Material-UI version is it for?
The README says this version is for Material-UI 1.0.0-rc.0 or later. For Material-UI 0.x, use the legacy version linked in the README.
How do I change how long the fade takes?
Use the animationDuration prop. It is given in milliseconds and defaults to 3000.
Can I turn off the spinner or the error icon?
Yes. disableSpinner hides the loading spinner, disableError hides the error icon, and disableTransition turns off the fade.
Does it accept other img attributes?
Yes. The README says all other props are passed through to the underlying img element.
What are the best material-ui-image alternatives?
Popular alternatives to material-ui-image include gatsby-background-image, react-loading and react-graceful-image. See all material-ui-image alternatives




















