Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@reelkit/angular-lightbox

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reelkit/angular-lightbox

Full-screen image and video gallery lightbox for Angular with touch gestures, transitions, and template customization

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

@reelkit/angular-lightbox

npm Bundle size Star on GitHub

Image gallery lightbox for Angular — opens full-screen with swipe navigation, keyboard controls, and transition effects. Every part of the UI is replaceable via template slots. ~12.5 kB gzip.

Live Demo

Installation

npm install @reelkit/angular-lightbox @reelkit/angular lucide-angular

Quick Start

import { Component, signal } from '@angular/core';
import {
  RkLightboxOverlayComponent,
  type LightboxItem,
} from '@reelkit/angular-lightbox';

@Component({
  standalone: true,
  imports: [RkLightboxOverlayComponent],
  template: `
    @for (img of images; track img.src; let i = $index) {
      <img [src]="img.src" (click)="open(i)" />
    }
    <rk-lightbox-overlay
      [isOpen]="isOpen()"
      [items]="images"
      [initialIndex]="startIndex()"
      (closed)="isOpen.set(false)"
    />
  `,
})
export class GalleryComponent {
  isOpen = signal(false);
  startIndex = signal(0);

  images: LightboxItem[] = [
    {
      src: 'https://example.com/image1.jpg',
      title: 'Sunset',
      description: 'Beautiful sunset over the ocean',
    },
    { src: 'https://example.com/image2.jpg', title: 'Mountains' },
  ];

  open(index: number) {
    this.startIndex.set(index);
    this.isOpen.set(true);
  }
}

Features

  • Touch gestures — swipe to navigate, swipe up to close
  • Keyboard navigation — arrow keys, Escape
  • Fullscreen — cross-browser Fullscreen API
  • Transitions — slide, fade, and zoom-in effects
  • Image preloading — adjacent images prefetched
  • Video slides (opt-in) — via rkLightboxSlide template slot
  • Counter — "1 / 10" indicator
  • Info overlay — title and description with gradient
  • Template slots — rkLightboxControls, rkLightboxNavigation, rkLightboxInfo, rkLightboxSlide to override any part
  • Sub-components — RkCloseButtonComponent, RkCounterComponent, RkFullscreenButtonComponent, RkSoundButtonComponent

Template Slots

DirectiveDescription
rkLightboxControlsCustom controls (close, counter, etc.)
rkLightboxNavigationCustom prev/next navigation arrows
rkLightboxInfoCustom title/description overlay
rkLightboxSlideCustom slide renderer (required for video slides)

API Reference

rk-lightbox-overlay Inputs

InputTypeDefaultDescription
isOpenbooleanrequiredControls lightbox visibility
itemsLightboxItem[]requiredArray of items to display
initialIndexnumber0Starting image index
transitionTransitionType'slide'Transition animation type
showInfobooleantrueShow title/description
loopbooleanfalseEnable infinite loop
enableNavKeysbooleantrueEnable keyboard navigation
enableWheelbooleantrueEnable mouse wheel
wheelDebounceMsnumber200Wheel debounce (ms)
transitionDurationnumber300Animation duration (ms)
swipeDistanceFactornumber0.12Swipe threshold (0-1)

rk-lightbox-overlay Outputs

OutputTypeDescription
closedvoidEmitted when lightbox closes
slideChangenumberEmitted after slide change

Types

interface LightboxItem {
  src: string;
  type?: 'image' | 'video';
  poster?: string;
  title?: string;
  description?: string;
  width?: number;
  height?: number;
}

type TransitionType = 'slide' | 'fade' | 'zoom-in';

Sub-components

Use these inside custom rkLightboxControls templates:

ComponentDescription
RkCloseButtonComponentClose button
RkCounterComponent"1 / 10" counter
RkFullscreenButtonComponentFullscreen toggle
RkSoundButtonComponentMute/unmute toggle

Keyboard Shortcuts

KeyAction
ArrowLeftPrevious image
ArrowRightNext image
EscapeClose lightbox (or exit fullscreen)

CSS Classes

All UI elements use CSS classes prefixed with rk-lightbox-:

ClassDescription
.rk-lightbox-overlayRoot container
.rk-lightbox-closeClose button
.rk-lightbox-navNavigation arrows
.rk-lightbox-nav-prevPrevious arrow
.rk-lightbox-nav-nextNext arrow
.rk-lightbox-counterImage counter
.rk-lightbox-btnControl buttons
.rk-lightbox-infoTitle/description container
.rk-lightbox-titleImage title
.rk-lightbox-descriptionImage description
.rk-lightbox-slideSlide container
.rk-lightbox-imgImage element
.rk-lightbox-video-containerVideo slide wrapper
.rk-lightbox-video-elementVideo element
.rk-lightbox-video-posterVideo poster image
.rk-lightbox-video-errorVideo error state container
.rk-lightbox-top-shadeTop gradient scrim
.rk-lightbox-spinnerDefault loading spinner
.rk-lightbox-img-errorImage error state container
.rk-lightbox-swipe-hintMobile swipe hint chip
.rk-lightbox-emptyEmpty state text

Theming via CSS custom properties

Every visual value is exposed as a --rk-lightbox-* custom property with a sensible default. Override at :root (or any ancestor of .rk-lightbox-overlay) to retheme without touching component source — see the Theming docs for the full token table.

Documentation

Docs, demos, and customization examples at reelkit.dev/docs/angular-lightbox.

Support

If ReelKit saved you some time, a star on GitHub would mean a lot — it's a small thing, but it really helps the project get noticed.

Star on GitHub

License

MIT

Keywords

angular

FAQs

Package last updated on 27 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts