Skip to content

Image

The AEM Image component renders an image using data from the AEM Image Model provided by the backend. It is designed for use within AEM-integrated React applications, ensuring that image assets and metadata are handled according to AEM best practices.

Some properties extend the base AEM model to provide additional features such as hover zoom and custom CSS classes.

PropTypeDescriptionOptionalFrom AEM Image Model
fileReferenceRenditionstringThe image rendition file reference from AEM.no
finishedbooleanTrue if the image has been processed by Scene7 and is finished.no
publishedbooleanTrue if the image has been processed by Scene7 and is published.no
dynamicAssetFallBackstringFallback asset URL if the dynamic asset fails to load.no
dynamicAssetSourcestringURL for the dynamic asset, with width/height based on breakpoints.yes
altTextstringAlternative text for accessibility.yes
aspectRatiostringAspect ratio of the image (default: “16by9”).yes
decorativebooleanIf true, the image is decorative and ignored by assistive tech.yes
lazyloadEnabledbooleanEnables lazy loading for the image.yes
smartCropSelectionCROP_SELECTIONSmart crop selection: e.g., landscape, portrait, or none.yes
clickBehaviourCLICK_BEHAVIOURDefines click behavior: ENLARGE (overlay), LINK (navigate), or DEFAULT.yes
linkAssetLinkModelLink model associated with the image.yes
classNameClassValueAdditional CSS class(es) for the image.yes
enableHoverZoombooleanEnables zoom-on-hover functionality.yes
import { Image } from '@tmedxp/aem-react-components/atoms/image';
const ImageAEMExample = () => (
<Image
fileReferenceRendition="/content/dam/toyota/sample-image.jpg"
finished={true}
published={true}
dynamicAssetFallBack="/content/dam/toyota/fallback-image.jpg"
dynamicAssetSource="https://scene7.com/is/image/Toyota/sample-image"
altText="Sample Toyota vehicle image"
aspectRatio="16by9"
decorative={false}
lazyloadEnabled={true}
smartCropSelection="Landscape"
clickBehaviour="DEFAULT"
className="my-custom-image-class"
enableHoverZoom={true}
/>
);
export { ImageAEMExample };