API Reference

Inputs, outputs, and interfaces for GalleryComponent.

GalleryComponent Inputs

Input Type Default Description
galleryImagesGalleryImage[][] Array of images to display
optionsGalleryOptions see below Gallery configuration
dialogDialogShareOptions see below Share dialog configuration
lang'en' | 'es''en' UI language

GalleryComponent Outputs

Output Type Description
imageChangenumber Fired when a thumbnail is clicked — emits the index
lightboxOpennumber Fired when the lightbox opens — emits the index
lightboxClosevoid Fired when the lightbox closes
lightboxImageChangenumber Fired when prev/next is used — emits the new index

GalleryImage

interface GalleryImage {
  src: string;        // Required — image URL
  width: number;      // Required — intrinsic width in px
  height: number;     // Required — intrinsic height in px
  alt?: string;       // Recommended for accessibility
  caption?: string;   // Optional caption text
  srcset?: string;    // Responsive image srcset
  sizes?: string;     // HTML sizes attribute
  loading?: 'lazy' | 'eager' | 'auto';
  objectFit?: 'contain' | 'cover' | 'fill' | 'none';
  slug?: string;
}

GalleryOptions

interface GalleryOptions {
  // Visibility
  showAllPicturesBtn?: boolean;  // default: true
  showControls?: boolean;        // default: true
  fullGallery?: boolean;         // default: true
  showCount?: boolean;           // default: true
  showShareBtn?: boolean;        // default: true
  showBullets?: boolean;         // default: false

  // Icons
  iconFamily?: 'heroicons' | 'lucide' | 'bootstrap'; // UI icon set — default: 'heroicons'

  // Layout
  layout?: { distribution: Distribution; orientation: 'horizontal' | 'vertical' };
  customLayout?: CustomStyles;
  layoutStyles?: { border?: string; height?: string; width?: string; gap?: string };
  allPictureBtnPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
  dialogShareOptions?: DialogShareOptions;

  // Navigation
  infinityLoop?: boolean;        // DISABLED in this version — ignored
  closeOnBackdropClick?: boolean; // default: false

  // Auto play
  autoPlay?: boolean;            // default: false
  autoPlayInterval?: number;     // default: 3000
  autoPlayPauseOnHover?: boolean; // default: false

  // Lightbox actions
  allowDownload?: boolean;       // default: false
  customActions?: GalleryAction[];
}

DialogShareOptions

interface DialogShareOptions {
  shareButtons: Array<
    'facebook' | 'twitter' | 'linkedin' | 'whatsapp'
    | 'email' | 'copy' | 'telegram' | 'instagram'
  >;
  title: string;        // Dialog heading
  subtitle: string;     // Dialog subheading
  description: string;  // Dialog body text
  picture: string;      // Preview image URL for the dialog
}

Layout Distributions

The library ships with 50+ named grid distributions , selected via options.layout . The naming convention is {top-row-count}/{bottom-row-count} .

Distribution Images Description
default 5 1 large hero + 4 thumbnails
1/1 2 Two equal-size rows
1/2 3 1 large + 2 small
1/3 4 1 large + 3 small
1/4 5 1 large + 4 small
2/2 4 2+2 equal grid
2/3 5 2+3
1/4/1 6 Mixed horizontal layout
5/5 10 2-row 5-column grid