Skip to main content

Overview

Galleria is a feature-rich image gallery component with thumbnails, slideshow, fullscreen, zoom, and many premium features.

Import

import { MagaryGalleria, GalleriaItem } from 'ng-magary';

Basic Usage

<magary-galleria
  [value]="images"
  [(activeIndex)]="activeIndex"
  [showThumbnails]="true">
</magary-galleria>

With Autoplay

<magary-galleria
  [value]="images"
  [(activeIndex)]="activeIndex"
  [autoPlay]="true"
  [transitionInterval]="3000"
  [circular]="true"
  [showProgressBar]="true">
</magary-galleria>

Thumbnail Positions

<magary-galleria
  [value]="images"
  [thumbnailsPosition]="'bottom'">
</magary-galleria>

With All Features

<magary-galleria
  [value]="images"
  [(activeIndex)]="activeIndex"
  [circular]="true"
  [autoPlay]="true"
  [transitionInterval]="5000"
  [showItemNavigators]="true"
  [showThumbnails]="true"
  [showThumbnailNavigators]="true"
  [showFullScreenButton]="true"
  [showDownloadButton]="true"
  [showShareButton]="true"
  [showProgressBar]="true"
  [showImageCounter]="true"
  [enableZoom]="true"
  [enableSwipe]="true"
  [enableKeyboardNavigation]="true"
  (onImageClick)="handleImageClick($event)"
  (onFullScreenChange)="handleFullscreenChange($event)">
</magary-galleria>

Input Properties

Core

value
GalleriaItem[]
default:"[]"
Array of images to display
activeIndex
number
default:"0"
Index of currently active image (two-way binding)
responsiveOptions
GalleriaResponsiveOptions[]
Responsive configuration

Display Options

showItemNavigators
boolean
default:"true"
Show previous/next navigation buttons
showThumbnails
boolean
default:"true"
Display thumbnail strip
thumbnailsPosition
'bottom' | 'top' | 'left' | 'right'
default:"'bottom'"
Position of thumbnail strip
showIndicators
boolean
default:"false"
Show page indicators
showImageCounter
boolean
default:"true"
Display image counter (e.g., “1 / 10”)

Behavior

circular
boolean
default:"true"
Enable circular navigation
autoPlay
boolean
default:"false"
Enable automatic slideshow
transitionInterval
number
default:"4000"
Slideshow interval in milliseconds
pauseOnHover
boolean
default:"true"
Pause autoplay on hover

Premium Features

showFullScreenButton
boolean
default:"true"
Show fullscreen toggle button
showDownloadButton
boolean
default:"true"
Show download button
showShareButton
boolean
default:"true"
Show share button
showProgressBar
boolean
default:"true"
Show autoplay progress bar
showPlayPauseButton
boolean
default:"true"
Show play/pause button

Zoom & Interaction

enableZoom
boolean
default:"true"
Enable zoom functionality
maxZoomLevel
number
default:"3"
Maximum zoom level
enableSwipe
boolean
default:"true"
Enable touch swipe navigation
enableKeyboardNavigation
boolean
default:"true"
Enable keyboard shortcuts
enableDoubleClickZoom
boolean
default:"true"
Zoom on double click
enablePinchZoom
boolean
default:"true"
Enable pinch to zoom on mobile

Output Events

activeIndexChange
EventEmitter<number>
Emitted when active image changes
onImageClick
EventEmitter<GalleriaItemEvent>
Emitted when image is clicked
onFullScreenChange
EventEmitter<boolean>
Emitted when fullscreen mode toggles
onImageLoad
EventEmitter<GalleriaImageLoadEvent>
Emitted when image loads
onImageError
EventEmitter<GalleriaImageLoadEvent>
Emitted when image fails to load
onShare
EventEmitter<GalleriaItemEvent>
Emitted when share button is clicked
onDownload
EventEmitter<GalleriaItemEvent>
Emitted when download button is clicked

GalleriaItem Interface

interface GalleriaItem {
  src: string;
  alt?: string;
  title?: string;
  description?: string;
  thumbnail?: string;
  type?: 'image' | 'video';
  videoUrl?: string;
}

Keyboard Shortcuts

  • Arrow Left/Right: Navigate images
  • Escape: Exit fullscreen/presentation
  • Space: Play/pause slideshow
  • +/-: Zoom in/out
  • 0: Reset zoom
  • F: Toggle fullscreen
  • P: Toggle presentation mode

Features

  • Fullscreen mode: Full-screen image viewing
  • Presentation mode: Auto-play slideshow
  • Zoom: Pan and zoom images
  • Touch gestures: Swipe and pinch
  • Progress bar: Visual autoplay progress
  • Download: Save images locally
  • Share: Native share API integration
  • Lazy loading: Load images on demand
  • Keyboard navigation: Full keyboard support
  • Responsive: Adapts to screen size

Accessibility

  • ARIA labels and roles
  • Keyboard navigation
  • Focus management
  • Screen reader announcements

Build docs developers (and LLMs) love