<Image> component automatically optimizes images for size, format, and loading.priority for above-the-fold images to optimize Largest Contentful Paint (LCP).fill prop allows images to fill their parent container for responsive layouts.1import Image from 'next/image';23export default function Hero() {4return (5<Image6src="/hero.jpg"7alt="Hero image"8width={1200}9height={600}10priority // Preload for LCP11placeholder="blur" // Show blur while loading12quality={85} // Compression (1-100)13sizes="(max-width: 768px) 100vw, 50vw"14/>15);16}1718// Fill mode for unknown dimensions19<div className="relative h-64">20// !mark21<Image src="/bg.jpg" alt="" fill className="object-cover" />22</div>;
sizes for optimal image selection.object-fit behaviors.| Prop | Purpose |
|---|---|
priority | Preload image, disable lazy loading |
placeholder | "blur" or "empty" |
sizes | Responsive image sizing hints |
fill | Fill parent container |
quality | Compression level (1-100, default 75) |
`next/image` serves the smallest viable image for the device.
| Topic | Guidance |
|---|---|
| LCP | Use priority on hero images |
| CLS | Always provide dimensions or use fill in a sized container |
| Formats | Let Next.js serve WebP/AVIF automatically |
priority on too many images.sizes to prevent over-downloading on mobile.




