Image

Data Display

An enhanced image component with loading states, error handling, and effects. Use this component for product images, galleries, or any image that benefits from loading feedback.

Import

import { Image, ZoomImage, ImageGallery } from "@/components/ui/image";

Usage

Basic Image

Image with loading state

Speaker

Aspect Ratios

Images with different aspect ratio constraints

Square

Square

Video (16:9)

Video

Wide (21:9)

Wide

Zoom on Hover

Image with zoom effect on hover

Zoom example

Error State

Image showing fallback on load error

Broken image

API Reference

src*
string

Image source URL

alt*
string

Alt text for accessibility

aspectRatio"auto"
"auto" | "square" | "video" | "wide"

Aspect ratio constraint

objectFit"cover"
"contain" | "cover" | "fill" | "none"

How the image fills its container

radius"none"
"none" | "sm" | "md" | "lg" | "full"

Border radius

showSkeletontrue
boolean

Show skeleton while loading

fallback
ReactNode

Content to show on error