Getting Started
Overview
Installation
Theme
Forms
Basic Inputs
Select
Custom Inputs
Components
Navigation
Components
69
Micro Charts
Libraries
Kanban Board
Image Designer
Video Player
Visual Builder
Content Editor
Data View
Latest npm version of @ngstarter-ui/componentsWeekly npm downloads of @ngstarter-ui/components
Purchase

Image viewer

Image Viewer opens a full-size image in a focused overlay from a thumbnail, card, or gallery item. Wrap the image group with ngsImageViewer, mark each clickable item with ngsImageViewerPicture, and pass sourceUrl for the full-size image.

The overlay supports close, loading state, zoom in and out, drag/pan when zoomed, and optional title, caption, and description through inputs or Angular templates. Use it for galleries, attachments, product images, media previews, portfolio cards, and other places where a user clicks a preview to inspect the full image.

Do not use Image Viewer for inline zoom inspection without an overlay, editing, crop selection, displayed-width resizing, before/after comparison, plain static images, video previews, or missing image placeholders. Use ImageZoomViewer, ImageDesigner, Crop, ImageResizer, ComparisonSlider, a normal img, VideoViewer, or ImagePlaceholder for those cases.

Key features:
  • Opens a full-size sourceUrl from a clickable preview.
  • Supports title, caption, and description content.
  • Includes zoom and drag/pan behavior in the overlay.
  • Works with any preview markup inside ngsImageViewerPicture.

API Image Viewer

import { ImageViewerDirective, IMAGE_VIEWER_PICTURE_DATA, IMAGE_VIEWER_PICTURE_REF, PictureOptions } from '@ngstarter-ui/components/image-viewer';

Directives
NameDescription
ngsImageViewerDirective that tracks clicks on images inside and opens a modal window for viewing.
ngsImageViewerPictureDirective that adds an image and customizes the source image that will be displayed in the modal window.
ngsImageViewerPictureTitleDirective that adds a title to an image modal.
ngsImageViewerPictureCaptionDirective that adds a caption to an image modal.
ngsImageViewerPictureDescriptionDirective that adds a description to an image modal.
PictureOptions / ngsImageViewerPicture Properties
NameDescriptionType
sourceUrl *
URL of the image to displaystring
title
Title of the imagestring
caption
Caption of the imagestring
description
Description of the imagestring
titleTplRef
Custom template for the titleTemplateRef<any>
captionTplRef
Custom template for the captionTemplateRef<any>
descriptionTplRef
Custom template for the descriptionTemplateRef<any>