Smart Image for Wappler
A full-stack image optimization extension for Wappler that automatically resizes, converts, and caches images on the fly — served through a clean <smart-img> component that is a direct drop-in replacement for the standard HTML <img> element.
Authors: Shalabh Gupta (@guptast) & Ben Pleysier (@ben)
Node.js only — This extension requires a Wappler Node.js project. It is not compatible with PHP or ASP.NET Wappler projects. The server-side processing depends on Node.js-specific libraries (Sharp, Express route hooks, and EJS templates).
Why Smart Image?
Replacing <img> with <smart-img> requires no configuration and gives you:
Automatic responsive images — the right size for mobile, tablet, and desktop
Retina / HiDPI support — 2× variants served automatically to high-density screens
Modern formats — WebP or AVIF generated on the fly from your original JPG/PNG
Blur-up placeholder — a blurred preview is shown instantly while the full image loads
Lazy loading — built in by default
Server-side caching — processed images are cached and served in subsequent requests at zero cost
Zero layout shift — set widthandheightto reserve space before load
Installation
Install via Wappler's built-in extension manager:
- Open your project in Wappler
- Go to Project Options → Extensions
- Search for and install Smart Image
Quick Start
Drop-in replacement for <img>
Simply swap <img> for <smart-img>:
Before
<img src="/assets/images/hero.jpg" alt="My Image">
After — responsive, retina-aware, lazy-loaded, with blur placeholder
<smart-img src="/assets/images/hero.jpg" alt="My Image"></smart-img>

