What problem does it solve?
This Skill helps you implement performant responsive images, ensuring optimal loading times and visual quality across all devices by leveraging modern formats, lazy loading, and correct attribute usage.
Core Features & Use Cases
- Responsive Sizing: Use
srcset and sizes to serve appropriately sized images for different viewports and screen densities.
- Modern Formats: Automatically provide WebP and AVIF versions with fallbacks for broader browser compatibility and smaller file sizes.
- Lazy Loading: Defer loading of offscreen images to improve initial page load performance.
- CLS Prevention: Ensure images have defined dimensions or aspect ratios to prevent layout shifts.
- Art Direction: Use the
<picture> element to serve different image crops or compositions based on media queries.
- Use Case: When adding a hero image to your homepage, use this skill to generate
srcset and sizes attributes, include AVIF/WebP versions, and set loading="eager" with fetchpriority="high" for optimal LCP.
Quick Start
Implement a responsive image using the responsive-images skill for the image located at '/images/hero.jpg', ensuring it's optimized for all devices.