Responsive Features
The Image Component comes with robust responsive features ready right out of the box. At the page template level, the design dialog can be used to define the default widths of the image asset. The Image Component automatically loads the correct width to display depending on the size of the browser window. As the window is resized, the Image Component dynamically loads the correct image size on the fly. There is no need for component developers to worry about defining custom media queries since the Image Component is already optimized to load your content.
In addition, the Image Component supports lazy loading to defer loading of the actual image asset until it is visible in the browser, increasing the responsiveness of your pages.
Differences with v2
Unlike version 2 of the Image Component, version 3 uses browser-native responsiveness. This means that it provides the browser with a set of sources for an image for different widths and the browser will pick the best.
Most of the time, browsers prefer to locally downsize a larger width to fit a smaller viewport instead of fetching the smaller width image from the server. This is expected and why the Image Component should not be used for art direction (different images/crops for different viewports).
Please see the technical documentation of the Image Component for more information.
Dynamic Media Support
The Image Component (as of release 2.13.0) supports Dynamic Media assets. When enabled, these features offer the ability to add Dynamic Media image assets with a simple drag-and-drop or via the assets browser just as you would any other image. In addition, image modifiers, image presets, and smart crops are also supported.
Your web experiences built with Core Components can feature rich, Sensei-powered, robust, high-performance, cross-platform Dynamic Media Image capabilities.
Remote Assets Support
The Image Component (as of release 2.23.2) supports remote assets. Once configured, you can select assets from a remote service for your image component.
SVG Support
Scalable Vector Graphics (SVG) are supported by the Image Component.
- Drag-and-drop of an SVG asset from DAM and upload of an SVG file uploaded from a local file system are both supported.
- The original SVG file is streamed (transformations are skipped).
- For an SVG image, the “smart images” and the “smart sizes” are set to an empty array in the image model.
Security
For security reasons, the original SVG is never called directly by the Image Editor. It is called through <img src="path-to-component">
. This prevents the browser from executing any scripts embedded in the SVG file.