Image
The Image component is for displaying images with layout and alignment options. It supports both internal and external sources and allows you to define how the image fits its container.
Fields
-
imageChooser(default:image) - A switchable field for selecting the image source:-
If
imageis selected:-
image(required) - Internal image chooser from Magnolia DAM. -
altText(optional) - Alt text for accessibility.
-
-
If
externalImageis selected:-
externalImage(required) - Full URL to the external image. -
externalImageAlt(optional) - Alt text for accessibility.
-
-
-
objectFit(default:contain) - A switchable field that controls how the image is resized to fit its container:-
contain- Image scales to fit within container without cropping.-
alignment(default:center) - Alignment of the image:-
left -
center -
right
-
-
-
cover- Image fills the container and may be cropped.
-
Behavior
-
If
objectFitis set tocover, the image fills the container and may be cropped. -
If
objectFitis set tocontain, the image scales to fit inside the container:-
The image is aligned based on the selected alignment.
-