Image

An image with a preview overlay, a fallback for a broken source and a placeholder for one still loading.

Preview

An Image opens a full-screen viewer on click, where you can zoom, rotate and flip it, and Esc closes it.

Corners

Put rounded-lg or rounded-full on classNames.root, so the image and its hover cover share the same corners.

Separate preview source

Pass preview.src to show a different file in the viewer, so the thumbnail stays small and the full image loads only when opened.

Preview off

Set preview={false} for a plain image with no viewer, like a logo or an avatar.

Controlled preview

Control the viewer with preview.open and preview.onOpenChange, so a button can open it instead of the thumbnail.

Custom mask

Set preview.mask to { blur: true } to blur the page behind the open viewer, or to false for no backdrop at all.

Custom cover

Pass a node to preview.cover to replace the hover overlay, like an eye glyph with a label or the glyph alone.

Fixed position

Set preview.movable to false so a zoomed image stays centered and cannot be dragged.

Zoom limits

Use scaleStep, minScale and maxScale in preview to set how far each zoom goes, or wheel: false to zoom only with the toolbar.

Custom image render

Use preview.imageRender to wrap the viewer's image, here with a download button in its top corner.

Custom toolbar

Use preview.actionsRender to keep the toolbar but pick its buttons, here zoom and rotate plus copy link and download.

PreviewGroup

Wrap images in Image.PreviewGroup so the viewer steps through all of them with next and previous buttons.

PreviewGroup from one image

Pass items to Image.PreviewGroup so one thumbnail opens a viewer with the whole set, like a cover photo for an album.

Placeholder

Pass placeholder a progress object with your own percent to show a loading box, then render the image once it reaches 100.

Indeterminate placeholder

Set placeholder={{ progress: true }} for a loading box that animates without a percent, to show until you render the image.

Fallback

Pass fallback an image to show when src fails to load, like a gray Not found tile instead of a broken image.

Lazy loading

Set loading="lazy" so the browser holds back images far down the page, with a placeholder showing until each one arrives.

In context

The component inside real screens, with the components it usually sits beside.
A grid of photos in one Image.PreviewGroup, so any of them opens a viewer that steps through all eight.

API Reference

Image
Image's props.
PlaceholderType
The fields of the object form of placeholder.
ImageProgressConfig
The fields of the object form of placeholder.progress.
PreviewType
The fields of the object form of preview. Rows marked antuikit in the Version column are added by the kit.
Image.PreviewGroup
Image.PreviewGroup's props.
PreviewGroupType
The fields of the object form of Image.PreviewGroup's preview. Rows marked antuikit in the Version column are added by the kit.