I'm using next/image
, which works great, except the actual image loading in is super jarring and there's no animation or fade in. Is there a way to accomplish this? I've tried a ton of things and none of them work.
Here's my code:
<Image
src={source}
alt=""
layout="responsive"
width={750}
height={height}
className="bg-gray-400"
loading="eager"
/>
According to the docs I can use the className
prop, but those are loaded immediately and I can't figure out any way to apply a class after it's loaded.
I also tried onLoad
, and according to this ticket, it isn't supported:
https://github.com/vercel/next.js/issues/20368