Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.1

Image

Image is a component that displays images with fallback support.

Source@yamada-ui/image

Import

import { Image } from "@yamada-ui/react"
Copied!

Usage

Editable example

<Image
  src="https://dragon-ball-official.com/assets/img/intro/intro_1.png"
  boxSize="xl"
/>
Copied!

Using Fallback

If you want to display a different image while the image is loading or if the load fails, specify the path to the image you want to display in fallback.

Editable example

<Image
  src="https://not-found.com/not-found.png"
  fallback="https://via.placeholder.com/512"
  boxSize="xl"
/>
Copied!

If you want to display the image specified in fallback only when the load fails, specify onError in fallbackStrategy.

Editable example

<Image
  src="https://not-found.com/not-found.png"
  fallback="https://via.placeholder.com/512"
  fallbackStrategy="onError"
  boxSize="xl"
/>
Copied!

Edit this page on GitHub

PreviousMedia and IconsNextNativeImage