How to show Images SMOOTHLY with Next.js Image Component
Вставка
- Опубліковано 14 жов 2024
- ❤️Please Support me by subscribing to my channel 👉🏻www.youtube.co...
In this tutorial video, I will be showing you how to use the Next.js Image element to load images seamlessly on your website. With the help of this powerful tool, you can ensure that your images are optimized and load quickly, without compromising on quality.
Thank you! Can you show blurDataURL as well if you get a chance?
What about if the image source is changing, how to smoothly transition even when the two different versions are requested directly after each other
How could this be done in a server component?
Very nice. But It will ignore the cached image. Would be nice if there is solution for this.
Hi, I do some research about it and let you know 🌹
great tip, thank you.
Thanks 😊👍
Works great! Thanks a lot 😊
Thanks for your nice feedback 🌷
Can you show code onloadingxomplte? I cant imagine that's code.or can you share fully image component code
The Image component is Next.js 13 Image component. you can find it in next.js documentation
@@SakuraDev image component nextjs have onLoadingComplete? i see i see thankyou 😍
i like trick of nextjs TNX
thanks
Nice trick 👍
thanks
ok, but how do I use it with placeholder='blur" in next component? when i use it, the blurDataURL also got with opacity-0 until the onLoadingComplete function trigger, please help me
you do know that you don't have to use a custom unit for a 2s transition speed right? I think that's 200 in tailwind. also, you can just set the oapcity to none. That's tailwind's version of removing it from the V dom. You must be just learning the tailwindcss library huh?
2s is 2000ms not 200
@@tamaspal1864 damn im dyslexic. Had i plugged it in, i'd have known this lol
One slight problem with this approach. If you add 2 seconds of delay in showing images, it further increases your LCP time which is poor for SEO. The LCP time should be less then 2.5 seconds at all cost. So even if you reduce the above number from 2 to 1 seconds, your LCP will still be affected as there is already some delay added to LCP due to latency and rendering code. So I won't recommend this approach for production use cases and specially not if SEO plays vital role in your Business. Perhaps there could be another way...
Nice tip 👍. I didn't know that. Thanks for bringing that to my attention 🙂
Always brother. Actually I too just realised this after I used this approach and did some SEO test.@@SakuraDev
Thanks
Thanks. I'm glad you found the video helpful