Progressive Image Bundle doesn't just use static dimensions; it operates with a Breakpoint-First approach. This means it calculates the exact width of the image based on your CSS grid.
In the configuration, you can choose one of the predefined frameworks or define your own.
progressive_image:
responsive_strategy:
grid:
framework: bootstrap # or 'tailwind'- bootstrap: 12 columns, breakpoints:
xs,sm,md,lg,xl,xxl. - tailwind: 12 columns, breakpoints:
default,sm,md,lg,xl,2xl. - custom: Here you define your own columns and container dimensions.
progressive_image:
responsive_strategy:
grid:
framework: custom
columns: 12
gutter: 24
layouts:
xl: { min_viewport: 1200, max_container: 1140 }
md: { min_viewport: 768, max_container: 720 }
sm: { min_viewport: 0, max_container: null } # null = 100vwYou can define global names for aspect ratios, which you then use in Twig templates.
progressive_image:
responsive_strategy:
ratios:
landscape: "16/9"
portrait: "3/4"
square: "1/1"
hero: "21/9"One of the key features of the bundle is that it never generates an image larger than its original.
If your grid calculates that for a given breakpoint you need an image with a width of 1200px, but your source file is only 1000px:
- The bundle automatically filters out all variants in
srcsetthat would be larger than 1000px. - The browser will thus never attempt to download an artificially enlarged (and therefore blurred) image.
- CPU resources and storage are saved.
The bundle automatically retrieves image dimensions using PHP streams and inserts them into the HTML. This ensures the browser reserves the exact space for the image before it's even downloaded. As a result, page content doesn't "jump" after the image loads.