spatie/statamic-responsive-images
Statamic addon by Spatie that adds a responsive image fieldtype with art direction and breakpoint support. Automatically generates responsive variants on asset upload and renders them in Antlers via the responsive tag, with configurable breakpoints and options.
ratio, src overrides, and breakpoint-based customization), aligning with performance best practices (e.g., srcset, sizes attributes, and format negotiation).composer require command). The fieldtype integrates directly into Statamic’s UI, reducing developer overhead.default queue), enabling async processing for large media libraries. Configurable via responsive-images.php.statamic.assets.image_manipulation.cache to generate images on-demand, which may impact initial load times for high-traffic sites. Mitigation: Use CDN caching or pre-generate critical images via the regenerate command.webp/avif settings globally or per-tag.lg:ratio="16/9").responsive-images.php?images) for image processing?srcset support)? Use polyfills or static fallbacks?assets, upload) to identify high-impact use cases (e.g., hero banners, product galleries).img tags with {{ responsive:field }} in templates.assets without use_breakpoints) in favor of the responsive fieldtype.blur, fit) can be passed via glide:param syntax.asset.saving) may interfere with image generation jobs. Mitigation: Test in isolation or coordinate with addon authors.statamic/glide is installed (included by default in Statamic 4+).php artisan queue:work).composer require spatie/statamic-responsive-images
php artisan vendor:publish --provider="Spatie\ResponsiveImages\ServiceProvider" # Optional: Customize views
config/responsive-images.php for breakpoints, format preferences, and excluded containers.statamic.assets.image_manipulation.cache to false (recommended for lazy generation).assets fields with the responsive fieldtype in blueprints.type: responsive
use_breakpoints: true
breakpoints: [sm, md, lg, xl]
{{ asset:field }} with {{ responsive:field }} in Twig/Antlers.{{ responsive:hero_image ratio="16/9" lg:ratio="2/1" }}
queue settings if needed.responsive-images.php, reducing scattered logic across templates.How can I help you explore Laravel packages today?