Image Loader

An advanced image loading component with beautiful loading states, error handling, and performance optimizations.

Installation

Install the Image Loader component using your preferred package manager.

npxshadcn@latest addhttps://rigidui.com/registry/image-loader

Usage

The Image Loader component provides a seamless image loading experience with animated patterns, smooth transitions, and comprehensive error handling.

Live Preview

Discover Its Features

The Image Loader component is packed with powerful features designed to provide an exceptional user experience.

Beautiful Loading States

Dynamic SVG patterns with gradient effects provide visually appealing loading experiences.

Optimized Performance

Lazy loading, async decoding, and efficient pattern generation for optimal performance.

Responsive Design

Automatically adapts to different screen sizes and container dimensions.

Error Handling

Graceful fallback states with customizable error components for failed image loads.

API Reference

PropTypeDefaultDescription
srcstringundefinedThe source URL of the image to load
altstringundefinedAlternative text for the image (required for accessibility)
classNamestring''Additional class names for styling
blurIntensitystring'blur(50px)'CSS blur filter intensity for the loading state
widthnumber | string400Width of the image container in pixels or CSS units
heightnumber | string300Height of the image container in pixels or CSS units
fallbackComponentReact.ReactNodeundefinedCustom component to display when image fails to load
onLoad() => voidundefinedCallback function called when image successfully loads
onError(error: Event) => voidundefinedCallback function called when image fails to load
loading'lazy' | 'eager''lazy'Native browser loading behavior for the image
objectFit'cover' | 'contain' | 'fill' | 'none' | 'scale-down''cover'How the image should be resized to fit its container
customColorsColorCombination[]undefinedCustom color combinations for the loading pattern
seednumberundefinedSeed value for generating consistent loading patterns