Image
Display images with enhanced loading states, accessibility features, and flexible layout options. Image provides skeleton placeholders, fade-in animations, and caption support.Display images with enhanced loading states, accessibility features, and flexible layout options. Image provides skeleton placeholders, fade-in animations, and caption support.
Installation
Usage
Props
Object Fit
Use the fit prop to control how the image scales to fit its container.
Cover
Scales image to cover the entire container. May crop edges but ensures no empty space. Best for hero images, thumbnails, and card backgrounds.
Contain
Scales image to fit entirely within the container. May leave empty space but shows the complete image. Best for product images, logos, and artwork.
Fill
Stretches image to fill the container exactly. May distort aspect ratio. Use with caution.
Scale Down
Acts like contain but never scales up beyond the original size. Prevents small images from becoming pixelated. Best for user-uploaded content.
None
Image keeps its original size. May overflow container or leave empty space. Best for pixel-perfect images.
Radius
Use the radius prop to apply rounded corners to images.
Loading States
Skeleton Placeholder
Use showSkeleton to display a skeleton animation while the image loads.
LQIP Placeholder
Use the placeholder prop with a low-quality image placeholder (LQIP) for a blurred preview while the main image loads.
Combined
Combine skeleton and placeholder for the best loading experience.
Fade In
By default, images fade in when loaded. Disable this with fadeIn={false}.
Captions
Use the caption prop to add descriptive text below the image.
Lazy Loading
Images use loading="lazy" by default for performance. Use loading="eager" for above-the-fold images.
Event Handlers
Handle load and error events for custom behavior.
With Next.js Image
Use the as prop to render with Next.js Image for automatic optimization.
Layout Props
Image supports margin, width, and height props for layout control.
Responsive Fit
Use responsive objects to change fit behavior across breakpoints.
Practical Examples
Product Card Image
Avatar
Hero Image
Chart with Caption
Gallery Image
Accessibility
Image provides comprehensive accessibility support.
Required Alt Text
The alt prop is required. Provide meaningful descriptions for screen readers.
Loading Announcements
Screen readers announce loading state via loadingAriaLabel.
Error Announcements
Screen readers announce errors via errorAriaLabel.
ARIA Attributes
Image automatically sets:
aria-busy="true"during loadingaria-invalid="true"on erroraria-describedbylinking to error message
Reduced Motion
Fade-in animations are disabled when the user prefers reduced motion.
High Contrast Mode
Images receive a visible border in Windows High Contrast mode for visibility.
Enhancements
Built-in Loading States
Native support for skeleton placeholders and LQIP patterns without additional wrapper components.
Automatic Caching Detection
Image detects already-cached images and skips the loading state for instant display.
Caption Support
Built-in caption styling with proper typography and spacing, eliminating the need for custom figure/figcaption markup.
Polymorphic Rendering
Use the as prop for seamless integration with Next.js Image or other optimized image components.
Changelog
0.1.95
Simplified component architecture and improved Next.js compatibility.
Added
- Polymorphic
asprop for Next.js Image and custom component support - Comprehensive test suite (35 tests)
Changed
- Flattened DOM structure (nested divs only when caption is present)
- Reduced component from ~430 to ~280 lines
Fixed
loadingAriaLabelnow properly renders screen reader announcements
Removed
- Unused
variantprop
Created
New component for Kookie UI (not part of Radix Themes).
- Enhanced image component with loading states and accessibility features
- Skeleton placeholder support via
showSkeletonprop - LQIP placeholder support via
placeholderprop - Fade-in animation with
fadeInprop (enabled by default) - Caption support with
captionprop - Comprehensive accessibility with
aria-busy,aria-invalid, and live announcements - Object-fit variants (
cover,contain,fill,scale-down,none) with responsive support - Lazy loading by default for performance
- Automatic cached image detection for instant display
- Windows High Contrast mode support
- Reduced motion support
© 2026 Kushagra Dhawan. Licensed under MIT. GitHub.