gitwtfhub

wtf is photoswipe?

dimsemenov/photoswipe — explained in plain English

Analysis updated 2026-05-18

25,142JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

A lightweight JavaScript image gallery and lightbox that works on desktop and mobile without requiring any framework dependencies.

Mindmap

mindmap
  root((PhotoSwipe))
    What it does
      Image gallery overlay
      Touch gestures support
      Mobile and desktop
    Key features
      Modular architecture
      No dependencies
      Swipe and pinch-zoom
    Use cases
      Add galleries to websites
      Mobile-friendly lightbox
      Portfolio showcases
    Tech stack
      JavaScript
      Touch events
      CSS animations

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Add a touch-friendly image gallery to a website without installing a heavy framework.

REASON 2

Build a portfolio or photography site with swipe-to-navigate lightbox functionality on mobile and desktop.

REASON 3

Create a product showcase with pinch-to-zoom and gesture controls for better user experience.

What's in the stack?

JavaScriptCSSTouch API

How it stacks up

dimsemenov/photoswipemax-eee/neopasssimple-icons/simple-icons
Stars25,14225,17625,049
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/52/51/5
Audiencedevelopervibe coderdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial, as long as you keep the copyright notice.

Wtf does this do

PhotoSwipe is a JavaScript image gallery and lightbox for websites. A lightbox is the pattern where clicking a thumbnail opens a large version of the image in an overlay, and you can swipe or click through multiple images. PhotoSwipe is specifically designed to work well on both desktop browsers and mobile touchscreens, without depending on any JavaScript framework like React or Vue. The library is modular, meaning you import only the parts you need, and it has no external dependencies. It supports touch gestures like swipe and pinch-to-zoom on mobile devices and works independently of the page layout beneath it. This repository contains version 5, which represents a major rewrite. The source code lives in the src folder and the ready-to-use compiled files are in the dist folder. Documentation and a live demo are available at photoswipe.com. You would use PhotoSwipe when you want to add a polished image gallery experience to any website, particularly when you need it to look and feel good on phones as well as desktops, and when you want to avoid a dependency on a large UI framework.

Yoink these prompts

Prompt 1
How do I add PhotoSwipe to my website and set up a basic image gallery with thumbnails?
Prompt 2
Show me how to customize PhotoSwipe's appearance and add my own CSS styling to the lightbox.
Prompt 3
How do I handle touch gestures like swipe and pinch-zoom in PhotoSwipe on mobile devices?
Prompt 4
What's the best way to integrate PhotoSwipe into a static HTML site without using a JavaScript framework?

Frequently asked questions

wtf is photoswipe?

A lightweight JavaScript image gallery and lightbox that works on desktop and mobile without requiring any framework dependencies.

What language is photoswipe written in?

Mainly JavaScript. The stack also includes JavaScript, CSS, Touch API.

What license does photoswipe use?

Use freely for any purpose including commercial, as long as you keep the copyright notice.

How hard is photoswipe to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is photoswipe for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.