An Almost Ideal React Image Component

Yes, this is a React component, but regardless if you care about that part or not, the “ideal image component" part could be of interest. There is a lot to consider with how we put images on web pages these days. This deals with:

Placeholder space (and then flexible responsive styles after loading)
Low-quality placeholder images
Responsive images syntax (srcset)
Image formats (e.g. using WebP when you can)
Click-to-load on bad network connections
Better UX for loading errors,

The post An Almost Ideal React Image Component appeared first on CSS-Tricks.