Image
#
A component that renders optimized and responsive images using Storyblok's image service. With support for lazy loading and LQIP (Low-Quality Image Placeholders).
The component will automatically try to load a WebP version of the image if the browser supports it.
Lazy loading uses the native browser implementation if available, otherwise an IntersectionObserver (polyfilled if needed) is used as fallback.
The low-quality image placeholder is a small (max 32 pixels wide), blurred version of the image that is loaded as fast as possible and presented while the full image is loading. As soon as the full image loads, the placeholder is faded out. Optionally the placeholder can be disabled, then it will just fade it in the full-size image.
#
ParametersImage
accepts the normal HTML img
attributes, but the src
is expected to be a Storyblok asset URL.
There are two important parameters that make sure the images are responsive: fixed
and fluid
. You should use one or the other.
fixed
: use if you know the exact size the image will be.fluid
: is made for images that stretch a container of variable size (different size based on screen size). Use if you don't know the exact size the image will be.