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

PropTypeDefaultDescription
src*stringImage source URL
alt*stringAlt text for accessibility
aspectRatio"auto" | "square" | "video" | "wide""auto"Aspect ratio constraint
objectFit"contain" | "cover" | "fill" | "none""cover"How the image fills its container
radius"none" | "sm" | "md" | "lg" | "full""none"Border radius
showSkeletonbooleantrueShow skeleton while loading
fallbackReactNodeContent to show on error

Related Components