ImageBlock
Simple media block for editorial images, campaign photography, and supporting visuals. Handles common aspect ratios and optional caption text.
Best for
Import
import { ImageBlock } from "@enadhq/enad-react-sdk/client/storefront"When to use it
Use ImageBlock when a page section needs a standalone image with an optional caption. It is the simplest visual block in the storefront system: no overlays, no CTAs, no text composition. Just an image at a consistent aspect ratio with optional figure caption.
For images with overlaid text or CTAs, use Hero or LinkBlock instead. For images paired with editorial copy side by side, use TextContentWithImage.
Composition notes
ImageBlock is a minimal prop-driven component:
imagetakes anImageAssetwithsrcandalt. Renders inside a<figure>element.aspectRatiocontrols the image crop:4:5(portrait, default),16:9(landscape), or1:1(square).captionrenders as a<figcaption>below the image when provided.classNameadds layout or max-width constraints.
Behavior and theming guidance
The image uses object-cover to fill the aspect ratio container, so it crops from the center on non-matching source images. This keeps visual consistency across pages without requiring exact image dimensions.
Captions render in a small muted text style below the image. They work well for attribution, location notes, and brief context that should not compete with the image.
Use className to constrain the block width (e.g. max-w-4xl) when it sits inside a wider layout context. Without a max-width, the image fills its container.
Examples
Live examples you can edit directly in the sandbox.
Portrait editorial image
A 4:5 portrait image with a caption. Good for showroom photography, product closeups, and editorial spreads.
Wide editorial image
A 16:9 wide image for landscape photography, workshop shots, and full-width section dividers.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| image | string | — | The image to display |
| aspectRatio | string | 4:5 | Aspect ratio of the image container |
| caption | string | — | Optional caption rendered below the image |
| className | string | — | No description yet. |