Prompt
I'm trying to add responsive image delivery to a Next.js app, what fits best?
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
For a Next.js app, the best fit is usually Next.js’s built-in Image component (next/image).
Why it’s the best default
- Automatic responsive sizing with
srcSetandsizes - Lazy loading by default
- Built-in optimization for format and quality
- Prevents layout shift when you provide dimensions
- Works well with modern Next.js apps without extra setup
Typical use
import Image from "next/image";
export default function Hero() {
return (
<Image
src="/hero.jpg"
alt="Hero image"
width={1200}
height={800}
sizes="(max-width: 768px) 100vw, 50vw"
/>
);
}
If you need full-bleed responsive images
Use fill plus sizes:
<div style={{ position: "relative", width: "100%", height: "400px" }}>
<Image
src="/hero.jpg"
alt="Hero image"
fill
sizes="100vw"
style={{ objectFit: "cover" }}
/>
</div>
When you might choose something else
- Static marketing site with a CDN: Cloudinary, Imgix, or similar may give you more control
- Very simple cases: plain
<img>if optimization doesn’t matter - Custom media pipeline: if you already have image transformations in your backend/CDN
Best practice
If you’re on Next.js and don’t have a special image pipeline already, start with:
next/image- correct
sizes - optimized source images
- a CDN if traffic is high
If you want, I can also show the best setup for responsive images in Next.js with sizes, fill, and art direction.