Image

Display images with built-in preview, fallback, and placeholder support.

When to Use

  • For images that should support click-to-preview with zoom
  • When you need fallback handling for broken images
  • For image galleries with grouped preview navigation

Import

import { Image } from "orizon";

Examples

Basic

Sample image
Preview
<Image width={200} src="https://picsum.photos/200/200" />

With Fallback

Display a fallback image when the source fails to load.

<Image
  width={200}
  src="broken-url.png"
  fallback="https://via.placeholder.com/200"
/>

Preview Group

Group multiple images for batch preview navigation.

<Image.PreviewGroup>
  <Image width={100} src="image1.png" />
  <Image width={100} src="image2.png" />
  <Image width={100} src="image3.png" />
</Image.PreviewGroup>

API

ImageProps

  • srcstring — Image source URL
  • altstring — Alt text
  • widthstring | number — Image width
  • heightstring | number — Image height
  • previewboolean | PreviewConfig — Enable preview (default: true)
  • fallbackstring — Fallback image URL on error
  • placeholderReactNode — Placeholder while loading
  • rootClassNamestring — Root element CSS class

PreviewConfig

  • visibleboolean — Controlled preview visibility
  • onVisibleChange(visible: boolean) => void — Visibility callback
  • scaleStepnumber — Zoom step size
  • minScalenumber — Minimum zoom level
  • maxScalenumber — Maximum zoom level

Image.PreviewGroup Props

  • previewboolean | GroupPreviewConfig — Group preview config
  • itemsstring[] — Image URLs for the group