Avara UI

Image Viewer

A collection of 4 production-ready, interactive, fully responsive E-commerce Product Image Viewer components featuring inner lens magnifying zoom, 3–10x floating zoom loupe, floating arrow carousel sliders, and active thumbnail strips.
ImageViewer isolates the image presentation layer for product showcases, galleries, and e-commerce catalogs with built-in fullscreen lightbox expansion and colorway synchronization.

Inner Lens Magnifier Zoom Viewer

Usevariant"inner-zoom"
magnifies the product image directly within the hero frame upon cursor hover (260% optical scale).

HD Side Portal Lens Zoom Viewer

Usevariant"side-zoom"
floats a 3x zoom loupe just above the hovered or touched point, with a reticle marking exactly the area it shows — it flips below when there is no room above and always stays inside the screen.
TunezoomLevel{6}
raises the magnification; 3–10 is the usual e-commerce range.

Floating Arrow Slider & Dots Viewer

Usevariant"slider"
features floating left and right chevron navigation buttons with backdrop blur, bottom dot indicators, and expandable lightbox.
Usevariant"thumbnails"
displays an active thumbnail preview gallery alongside the main hero image with expandable lightbox.
PlacementthumbnailPosition"left" | "right" | "bottom"
controls the thumbnail strip position ("left" displayed in preview; also supports "right" and "bottom").

Installation

New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.

Install Image Viewer

npx shadcn@latest add @algorize-ui/image-viewer

components/custom/blocks/ImageViewerBlock.tsx is written into your project. Copy any snippet from a Usage tab above and it runs.

Install dependencies

Nothing beyond the shared setup — Image Viewer needs only the cn helper and lucide-react, which the installation guide already put in place.

Features

Discover the key capabilities of the ImageViewer component:

4 Dedicated Viewer Architectures

Includes Inner Lens Zoom, Side Portal Zoom Projection, Floating Arrow Slider, and Active Thumbnail Strip Gallery.

Integrated Lightbox Modal

Theme-adaptive frosted glass overlay matching Light and Dark mode with keyboard controls, chevron navigation, and thumbnail strip.

High-Definition Optical Zoom

Experience smooth 2.6x inner frame magnification or a 3–10x floating zoom loupe on cursor hover and touch drag.

100% Mobile Responsive

Fluid aspect ratio framing and touch-friendly controls tested across mobile phones, tablets, and desktop displays.

Props Reference

PropTypeDefaultDescription
variant"inner-zoom" | "side-zoom" | "slider" | "thumbnails""inner-zoom"Selects the image viewing architecture.
thumbnailPosition"left" | "right" | "bottom""left"Position of the thumbnail preview strip when using variant="thumbnails". Supports vertical "left", vertical "right", and horizontal "bottom".
defaultImagenumber3 (side-zoom) / 1 (slider) / 2 (thumbnails) / 0 (others)Initial active image index (0-indexed). Defaults to index 3 (4th image) for side-zoom, index 1 (2nd image) for slider, and index 2 (3rd image) for thumbnails.
imagesstring[]DEFAULT_IMAGESArray of product or gallery image URLs to display.
colorsImageViewerColor[]DEFAULT_COLORSOptional colorways, one per image. Colorway i's bgClass tints the frame and thumbnail behind image i.
badgestring"20% OFF"Text displayed inside the top-left floating promo chip badge.
showWishlistbooleantrueToggles the floating top-right heart wishlist button.
enableLightboxbooleantrueWhether clicking the hero image triggers the fullscreen modal lightbox (active in slider and thumbnails).
zoomLevelnumber3Magnification of the side-zoom loupe over the image as it appears in the frame; 3–10 is the usual e-commerce range. The reticle shrinks to match. Serve images large enough to stay sharp at it — roughly the frame width × 1.4 × zoomLevel.
onImageChange(index: number) => voidundefinedCallback triggered whenever the user switches the active image.
classNamestringundefinedAdditional Tailwind CSS classes applied to the root container.