nextjs-image-art-direction

Implement art direction for Next.js images using getImageProps and picture elements.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/dev-khoi/AURA-conHack-2026 --skill nextjs-image-art-direction-dev-khoi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs-image-art-direction
Source: https://github.com/dev-khoi/AURA-conHack-2026/tree/main/.opencode/skills/nextjs-image-art-direction
Command: npx skills add https://github.com/dev-khoi/AURA-conHack-2026 --skill nextjs-image-art-direction-dev-khoi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Serving the same image to all devices wastes bandwidth and breaks layouts when mobile and desktop need completely different crops, compositions, or assets. This Skill guides you through implementing true art direction in Next.js so each viewport receives the correct image. ## Core Features & Use Cases - Art Direction with getImageProps(): Generate separate srcSet values for desktop, tablet, and mobile images and combine them with <picture> and <source> media queries. - Breakpoint Strategy Guidance: Learn correct source ordering (first match wins), shared alt/sizes props, and how to avoid pitfalls like preload, loading="eager", and unsupported placeholder props. - CSS Background Images: Convert srcSet output into image-set() for optimized responsive background images. - Use Case: A homepage hero carousel needs a wide landscape banner on desktop and a portrait crop on mobile. Use this Skill to build a picture element that serves each asset only to matching viewports while keeping LCP fast with fetchPriority="high". ## Quick Start Implement art direction for my Next.js hero section with different desktop and mobile images using getImageProps.

Frequently Asked Questions about nextjs-image-art-direction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I show different images for mobile and desktop in Next.js?▼

Use getImageProps() to generate separate srcSet values for each image version, then render them inside a picture element with source tags using media queries. Place an img element last as the fallback for unmatched viewports.

What is the difference between art direction and responsive images in Next.js?▼

Art direction serves completely different images per viewport using picture and source elements, while responsive images serve the same image at different sizes via the sizes prop and srcset. Use art direction when composition or assets differ between breakpoints.

Does getImageProps support the placeholder or preload props?▼

No. getImageProps does not support the placeholder prop, and using preload or loading="eager" would force all image versions to download. Use fetchPriority="high" instead to prioritize the LCP image.

Why are all my art-directed images loading at once?▼

This happens when preload or loading="eager" is set on getImageProps calls, causing the browser to fetch every source. Remove those props and rely on media queries so only the matching source loads.

Can I use getImageProps for CSS background images?▼

Yes. Extract the srcSet from getImageProps, split it into URL and density pairs, and build an image-set() value for the CSS backgroundImage property. This gives you optimized responsive backgrounds.