Basic usage
With fallback
Provide a fallback image URL that displays if the primary image fails to load.Object fit
Control how the image fits within its container.Border radius
Apply different border radius styles.Responsive images
Set width and height with CSS units for responsive behavior.Lazy loading
Images are lazy-loaded by default for better performance.Error handling
Handle image load errors with custom logic.Custom styling
Apply custom styles and classes.Image gallery
Combine with other components for a gallery layout.API reference
Image
string
Image source URL.
string
default:"''"
Alternative text for the image. Important for accessibility.
string
Fallback image URL to display if the primary image fails to load.
string | number
Width of the image. Can be a number (pixels) or string (CSS unit).
string | number
Height of the image. Can be a number (pixels) or string (CSS unit).
'contain' | 'cover' | 'fill'
default:"'cover'"
How the image should fit within its container (object-fit CSS property).
'none' | 'small' | 'medium' | 'full'
default:"'none'"
Border radius style for the image.
string
Additional CSS classes to apply.
React.CSSProperties
Inline styles to apply to the image.
'lazy' | 'eager'
default:"'lazy'"
Loading behavior for the image.
'sync' | 'async' | 'auto'
default:"'async'"
Image decoding behavior.
(event: React.SyntheticEvent<HTMLImageElement>) => void
Callback fired when the image fails to load.