Lightweight image/video gallery lightbox for SolidJS.
- Fullscreen image & video preview
- Thumbnail strip navigation
- Zoom (wheel, double-click, +/- buttons)
- Pan when zoomed
- Swipe navigation between items
- Keyboard shortcuts (arrows, Esc, +/-, 0)
- Programmatic API (
openGallery,openLightbox,closeLightbox) - Zero dependencies (only
solid-jspeer dep) - MIT license
npm install solid-lightbox solid-jsimport { openGallery, openLightbox } from 'solid-lightbox'
import 'solid-lightbox/styles.css'
// Single image
openLightbox({ src: '/photo.jpg' })
// Gallery with thumbnails
openGallery([
{ src: '/photo1.jpg', thumb: '/thumb1.jpg', caption: 'First' },
{ src: '/photo2.jpg', thumb: '/thumb2.jpg', caption: 'Second' },
{ src: '/video.mp4', type: 'video/mp4' },
], 0) // start at index 0import { Lightbox } from 'solid-lightbox'
import 'solid-lightbox/styles.css'
<Lightbox
items={items()}
index={currentIndex()}
open={isOpen()}
onClose={() => setIsOpen(false)}
maxZoom={4}
/>type LightboxItem = {
src: string
thumb?: string
alt?: string
width?: number
height?: number
caption?: string
type?: string // MIME type, e.g. 'video/mp4'
}MIT