React Smart Image Gets a Major Upgrade: More Performance, More Control, Better Developer Experience
.jpg)
Images are one of the most important parts of a modern web experienceβbut they can also become a major source of performance problems.
Large images can affect LCP, unexpected image dimensions can contribute to CLS, and handling responsive images, modern formats, loading states, zooming, transitions, and caching often requires a lot of custom code.
Thatβs why we built React Smart Image to make image handling simpler while keeping performance and flexibility in mind.
Following our previous release, the latest version introduces a much broader set of features designed for real-world React applicationsβfrom optimized hero images and responsive galleries to product images and high-resolution previews.
Table of Contents
Use AI to summarize this article
Whatβs New?
The latest release adds several powerful capabilities:
- Priority image loading for better LCP
- Aspect ratio support for CLS prevention
- AVIF and WebP format detection
- Click-to-zoom and fullscreen viewing
- Inline magnification and cursor-following magnifier
- Image prefetching
- Responsive image prefetching
- Configurable loading transitions
- Application-wide defaults with SmartImageProvider
- Reusable image presets
- Object-fit and object-position support
- Image download progress tracking
- Viewport visibility tracking
- Improved cache-aware load information
Letβs look at the major additions.
1. Priority Loading for Better LCP
Hero images are often among the most important elements on a page, especially when they appear above the fold.
The new priority prop allows you to tell React Smart Image that an image should be loaded immediately.
<SmartImage
Β Β src="/images/hero.jpg"
Β Β priority
Β Β alt="Hero image"
/>
β
When priority is enabled, the component uses eager loading, high fetch priority, and image preloading where appropriate.
Responsive images can also use responsive preload information so the browser can start fetching the appropriate candidate earlier.
This is particularly useful for:
- Hero banners
- Main product images
- Landing-page visuals
- Featured content
The goal is simple: get important images onto the screen as early as possible.
2. Aspect Ratio to Prevent Layout Shifts
Images loading after the initial page render can cause content to jump around.
The new aspectRatio prop reserves the required space before the image finishes loading.
<SmartImage
Β Β src="/images/product.jpg"
Β Β aspectRatio={16 / 9}
Β Β alt="Product"
/>
β
You can also provide a CSS value:
<SmartImage
Β Β src="/images/banner.jpg"
Β Β aspectRatio="16 / 9"
Β Β alt="Banner"
/>
β
This helps create a more stable layout and can reduce Cumulative Layout Shift (CLS).
3. AVIF + WebP Support
Modern image formats can significantly reduce image size while maintaining visual quality.
React Smart Image now supports AVIF detection through the new avif prop.
You can also use:
<SmartImage
Β Β src="/images/photo.jpg"
Β Β format="auto"
Β Β alt="Photo"
/>
β
With format="auto", the component checks formats in this order:
AVIF β WebP β Original
This gives developers an easy way to adopt modern image formats without manually implementing format detection.
4. Click-to-Zoom and Advanced Image Viewing
Images often need to be viewed at a larger sizeβespecially in product catalogs, galleries, portfolios, and documentation.
The new zoom system introduces multiple viewing modes.
<SmartImage
Β Β src="/images/product-thumb.jpg"
Β Β zoom
Β Β zoomSrc="/images/product-large.jpg"
Β Β alt="Product"
/>
β
The available modes include:
- lightbox β opens the image in a modal
- fullscreen β opens the image with fullscreen support
- inline β magnifies the image in place
- magnifier β provides a cursor-following magnifying lens
You can also customize animations, toolbar actions, scale, captions, backdrop behavior, and close controls.
High-Resolution Zoom Images
One particularly useful feature is zoomSrc.
Your page can load a smaller image normally while opening a separate high-resolution image when the user zooms.
<SmartImage
Β Β src="/images/product-small.jpg"
Β Β zoom
Β Β zoomSrc="/images/product-large.jpg"
/>
β
This helps avoid unnecessarily downloading large images before the user actually needs them.
5. Image Prefetching
Sometimes you know an image will probably be needed soon.
For example, when displaying a gallery, you can preload the next image before the user navigates to it.
<SmartImage
Β Β src="/images/next-product.jpg"
Β Β prefetch
Β Β alt="Next product"
/>
β
There is also a standalone helper:
prefetchImage("/images/next-product.jpg");
β
This can be useful for:
- Galleries
- Carousels
- Product catalogs
- Image sliders
- Next/previous navigation
React Smart Image can also prefetch a separate zoomSrc when zoom functionality is enabled.
6. Configurable Image Transitions
Image loading doesn't have to be limited to a simple fade.
The new transition prop supports multiple animation styles:
- none
- fade
- flip
- rotate
- grow
- scale
- slide-up
- slide-left
- reveal
For example:
<SmartImage
Β Β src="/images/photo.jpg"
Β Β transition="reveal"
Β Β transitionDuration={400}
Β Β alt="Photo"
/>
β
You can also use the convenient fade shorthand:
<SmartImage
Β Β src="/images/photo.jpg"
Β Β fade
Β Β alt="Photo"
/>
β
This gives developers more control over how images appear without having to build custom CSS animations for every implementation.
7. SmartImageProvider
When an application contains dozens or hundreds of images, repeating the same props everywhere can become difficult to maintain.
The new SmartImageProvider allows you to define shared defaults once.
<SmartImageProvider
Β Β defaults={{
Β Β Β Β responsive: true,
Β Β Β Β transition: "fade",
Β Β Β Β retry: 2,
Β Β Β Β placeholder: "blur"
Β Β }}
>
Β Β <App />
</SmartImageProvider>
β
Now all SmartImage components inside the provider can inherit these settings.
Individual component props can still override the provider defaults.
This makes it easier to maintain consistent image behavior across an entire application.
8. Reusable Image Presets
Different images often need different configurations.
For example:
- Hero images need priority loading
- Product images need zoom
- Avatars may need specific cropping
- Gallery images may need prefetching
Instead of repeating configurations, you can create reusable presets.
const presets = createImagePresets({
Β Β hero: {
Β Β Β Β priority: true,
Β Β Β Β aspectRatio: "16 / 9"
Β Β },
Β Β product: {
Β Β Β Β zoom: true,
Β Β Β Β transition: "fade"
Β Β },
Β Β avatar: {
Β Β Β Β objectFit: "cover"
Β Β }
});
β
Then use them directly:
<SmartImage
Β Β preset="product"
Β Β src="/images/product.jpg"
Β Β alt="Product"
/>
β
The resolution order is:
Component props β Preset config β Provider defaults β Library defaults
This makes large applications much easier to configure consistently.
9. Object Fit and Object Position
Images don't always need to display naturally inside their container.
The new objectFit and objectPosition props provide direct control over image cropping.
<SmartImage
Β Β src="/images/banner.jpg"
Β Β objectFit="cover"
Β Β objectPosition="top"
Β Β alt="Banner"
/>
β
This is particularly useful for:
- Profile images
- Product cards
- Hero sections
- Blog thumbnails
- Card layouts
10. Track Image Download Progress
Large images can take noticeable time to download.
The new onLoadProgress callback provides byte-level loading information:
<SmartImage
Β Β src="/images/large-image.jpg"
Β Β onLoadProgress={({ loaded, total, progress }) => {
Β Β Β Β console.log(progress);
Β Β }}
Β Β alt="Large image"
/>
β
This makes it possible to build custom progress indicators for large assets.
The feature works when the browser supports fetch and ReadableStream, with the appropriate same-origin or CORS configuration.
11. Track When an Image Becomes Visible
The new onVisible callback fires the first time an image enters the viewport.
<SmartImage
Β Β src="/images/product.jpg"
Β Β onVisible={() => {
Β Β Β Β console.log("Image became visible");
Β Β }}
Β Β alt="Product"
/>
β
Visibility is detected with a 100px pre-load margin and works independently from the lazy setting.
This can be useful for:
- Impression analytics
- Content visibility tracking
- Custom metrics
- Gallery behavior
- Advertising measurements
β
This gives analytics and performance monitoring systems more accurate information about image loadingβeven when the browser already has the image cached.
Built for Real React Applications
The goal of React Smart Image isn't to provide another simple <img> wrapper.
It's designed to bring commonly required image functionality into a single reusable component:
Performance β Loading β Responsive images β Modern formats β UX β Zoom β Prefetching β Analytics
Instead of installing multiple libraries or creating custom image logic for every project, developers can configure these capabilities directly through React Smart Image.
Upgrade Your React Image Workflow
If your React application contains hero images, product galleries, dashboards, portfolios, blogs, or other image-heavy interfaces, the latest release gives you significantly more control over how images are loaded and displayed.
You can explore the complete documentation, examples, and latest features on the React Smart Image website.
Live Demo
https://react-smart-image.netlify.app/
GitHub Repository
https://github.com/concatstring-account/react-smart-image
npm Package
https://www.npmjs.com/package/@concatstring/react-smart-image
β
The latest release is a step toward making image optimization not just fasterβbut also simpler, more configurable, and easier to maintain.

.png)
.png)
.png)



