question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support srcset in CardMedia

See original GitHub issue

CardMedia component doesn’t seem to support responsive images.

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Should be able to pass in a srcset attribute for image components in general.

Current Behavior

Not supported?

https://material-ui.com/api/card-media/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Jun 4, 2018

@adeelibr Thanks for sharing. I guess we can start experimenting with this workaround.

0reactions
oliviertassinaricommented, Aug 15, 2018

@kaycebasques Actually, it’s supported, you can use the component property to render an image over a div with a background image.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support srcset in CardMedia · Issue #11675 · mui/material-ui
CardMedia component doesn't seem to support responsive images. This is a v1.x issue (v0.x is no longer maintained).
Read more >
MUI: either `image` or `src` property must be specified
It's looks like CardMedia need an image ...
Read more >
Srcset and sizes attributes | | Can I use... Support tables for ...
The srcset and sizes attributes on img (or source ) elements allow authors to define various image resources and "hints" that assist a...
Read more >
How to properly use images in a responsive way : r/reactjs
What's CardMedia? Something from Material UI? No matter, check out image srcSet, or switch out images with CSS media queues.
Read more >
Picture perfect images with the modern <img> element
Request your key hero image early; Use srcset + efficient modern image ... The <picture> element supports multiple <source> elements and a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found