skillfed

mkdocs-glightbox

MkDocs plugin supports image lightbox with GLightbox.

mkdocs-glightbox v0.5.2 1.4M downloads/30d#3,909 on PyPI188
Permissive license MIT Active released

What it is and what it does

mkdocs-glightbox is a MkDocs plugin that automatically enhances images in your documentation with an interactive lightbox viewer. When you build your site, the plugin scans all image tags and wraps them with the GLightbox JavaScript library, which provides a modal image viewer with touch navigation, zoom, drag controls, and mobile support. The plugin uses selectolax to parse and modify the HTML.

You control the behavior through mkdocs.yml configuration: enable or disable the lightbox globally, skip specific images by CSS class, customize effects and animations, add captions from image alt text, group images into galleries, and toggle features like zoom and dragging. You can also disable the lightbox for entire pages or enable it selectively on pages where it's otherwise disabled, making it flexible for mixed documentation styles.

Use it for:

  • Add interactive image viewing to technical documentation without modifying individual Markdown files
  • Create image galleries in your MkDocs site with grouped navigation and swipe controls
  • Automatically caption images using their alt text while keeping Markdown source clean
  • Disable lightbox for specific images (logos, icons) while enabling it for screenshots and diagrams
  • Support mobile documentation viewers with touch-friendly image navigation and zoom

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A MkDocs plugin that automatically wraps images in a lightbox viewer powered by the GLightbox JavaScript library, with support for galleries, captions, and per-image or per-page customization.

Yes. The plugin is production-stable, actively maintained, has low install friction, carries no known vulnerabilities, and solves a common documentation need (interactive images) with minimal configuration. Install it if you use MkDocs and want lightbox functionality without manual HTML editing.

Install

mkdocs-glightbox on PyPI

pip

pip install mkdocs-glightbox

uv

uv add mkdocs-glightbox

poetry

poetry add mkdocs-glightbox

Installing mkdocs-glightbox

Before you install

Low friction install with a single runtime dependency (selectolax). The package is actively maintained with a recent release, marked as Production/Stable, and supports current Python versions from 3.8 through 3.14.

License in practice

MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install mkdocs-glightbox

Then add to mkdocs.yml:
plugins:
  - glightbox

Verify before relying

  • Whether GLightbox JavaScript file version 3.3.1 is automatically bundled or must be manually added to the site
  • Specific behavior when images are already wrapped in anchor tags or are emoji from pymdown-extensions

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — selectolax
Maintenance actively maintained — 295 days since the last release
Last repo commit
First released
Downloads 1,432,198/month — #3,909 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mkdocs_glightbox-0.5.2-py3-none-any.whl

Keywords: glightbox, mkdocs, plugin

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Text Processing

Tags

mkdocs image lightbox pluginglightbox mkdocs integrationimage gallery mkdocsmkdocs image viewerlightbox effect documentationmkdocs photo galleryimage modal mkdocs
mkdocs-pluginimage-viewerdocumentation-tool

More Text Processing packages

regex

A drop-in replacement for Python's standard…

permissive · top 100 on PyPI

pyparsing

pyparsing provides a library for building text…

permissive · top 1,000 on PyPI

docutils

Docutils converts plaintext documentation in…

unclear · top 1,000 on PyPI

RapidFuzz

RapidFuzz provides fast fuzzy string matching…

permissive · top 1,000 on PyPI

tinycss2

tinycss2 parses CSS strings into token and…

permissive · top 1,000 on PyPI

llama-parse

LlamaParse parses complex documents (PDFs,…

permissive · top 1,000 on PyPI

mkdocs-drawio

A MkDocs plugin that embeds interactive Drawio…

permissive · top 15,000 on PyPI

mkdocs-panzoom-plugin

Adds interactive pan and zoom functionality to…

permissive · top 5,000 on PyPI

mkdocs-video

A MkDocs plugin that embeds videos in…

permissive · top 15,000 on PyPI

mkdocs-swagger-ui-tag

A MkDocs plugin that embeds Swagger UI directly…

permissive · top 15,000 on PyPI

mkdocs-material

Material for MkDocs is a professional theme and…

permissive · top 5,000 on PyPI

mkdocs-awesome-pages-plugin

A plugin for MkDocs that lets you customize…

permissive · top 5,000 on PyPI

mkdocs-kroki-plugin

A MkDocs plugin that converts Kroki diagram…

permissive · top 15,000 on PyPI

mkdocs-print-site-plugin

MkDocs plugin that generates a combined print…

permissive · top 15,000 on PyPI

mdformat-mkdocs

An mdformat plugin that formats Markdown for…

permissive · top 15,000 on PyPI

mkdocs-plugin-inline-svg

A MkDocs plugin that replaces SVG image…

permissive · top 15,000 on PyPI