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" />

Official Astro documentation

More components and layouts commands

All components and layouts commands · Astro cheatsheet

Was this page helpful?