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/Video Model
typeAssetTypeThe asset type: e.g., Image, Video.
pathstringThe asset path exported from the backend.
domainstringThe Scene7 domain used to build the final asset URL.
folderstringThe folder path where the asset has been placed.
titlestringThe asset name.
fileStatusScene7FileStatusThe scne7 status: e.g., PublishComplete, PublishIncomplete,PublishFailed etc .
statusAssetStatusIndicates the asset’s state, Finished, InProgress,Failed etc .
assetStateAssetStatusIndicates the asset’s state, Finished, InProgress,Failed etc .
altTextstringAlternative text for accessibility.
altLanguagesstring[]Localized alt text values for different languages.
publishTimeStampnumberTimestamp of the asset’s last publish event.
scene7FileAvsstringScene7 Adaptive Video Set or rendition identifier used to build the encodes video path.
fileReferencestringThe original DAM file reference path.
PropTypeDescriptionOptionalFrom AEM Image Model
altTextstringAlternative text for accessibility.
smartCropSelectionCROP_SELECTIONSmart crop selection: e.g., landscape, portrait, or none.
damMetadataAssetMetadataThe asset metadata exported from BE.
decorativebooleanIf true, the image is decorative and ignored by assistive tech.
clickBehaviourCLICK_BEHAVIOURDefines click behavior: ENLARGE (overlay), LINK (navigate), or DEFAULT.
linkAssetLinkModelLink model associated with the image.
classNameClassValueAdditional CSS class(es) for the image.
enableHoverZoombooleanEnables zoom-on-hover functionality.
usePlaceholderbooleanRenders a simple placeholder instead of loading the actual image.
import { Image } from '@tmedxp/aem-react-components/atoms/image';
const ImageAEMExample = () => (
<Image
altText="Sample Toyota vehicle image"
enableHoverZoom={true}
smartCropSelection="Landscape"
clickBehaviour="default"
className="my-custom-image-class"
aspectRatio="is-9-16"
decorative={false}
lazyloadEnabled={false}
damMetadata={{
assetState: 'processed',
type: 'Image',
path: 'toyotaeuropetest/Hero-Image-2-3',
domain: 'https://scene7.toyota.eu/',
folder: 'toyotaeuropetest/qa-foundation/dam-asset-metadata/',
title: 'Hero-Image-2-3',
fileStatus: 'PublishComplete',
status: 'Finished',
altText: 'Alt',
altLanguages: [],
publishTimeStamp: 1_765_969_735_882,
scene7FileAvs: '',
fileReference:
'/content/dam/qa-foundation/dam-asset-metadata/Hero-Image-2.png',
}}
/>
);
export { ImageAEMExample };