Image
Image
is a component that displays images with fallback support.
Import
import { Image } from "@yamada-ui/react"
Usage
Editable example
<Image src="https://dragon-ball-official.com/assets/img/intro/intro_1.png" boxSize="xl" />
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" />
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" />
Edit this page on GitHub