Importance of Custom Image Renderer
Don’t we all agree that when information is presented in a visual/graphical format, it creates deeper impact on the user! This enhances the UX (User Experience) altogether.Improving user experience helps in:
- Increasing user retention
- Decreasing bounce rates on your website
Custom Image Renderer.
This component helps in handling images from the admin panel.
Custom Image Renderer
ExpCustomImageRenderer renders custom images based on different configurations and data sources. It accepts various props such as imageData, dataSource, contentLibraryImageData, and others to customize the image rendering.
The component handles two data sources: CONTENT_LIBRARY and FREE_FORM. If the data source is CONTENT_LIBRARY, it uses an image parser utility to parse the contentLibraryImageData and extract relevant image information. If the data source is FREE_FORM, it iterates over different view types (desktop, tablet, mobile) and processes the imageData accordingly.
The ExpCustomImageRenderer component is utilized when components have a dataSource as FREE_FORM, regardless of whether they also have CONTENT_LIBRARY. It is designed to handle both cases seamlessly.
The ExpCustomImageRenderer component accepts the following props:
Here is an example to show the usage of
ExpCustomImageRenderer.
ExpCustomImageRenderer component.
Head to the next document to learn more about the Menu Component in this base theme.