Astro · Components and layouts
Optimize images
The Image component resizes, converts and lazy-loads images and sets width and height.
---
import { Image } from "astro:assets";
import hero from "../assets/hero.png";
---
<Image src={hero} alt="A mountain at sunrise" />