mkdocs-glightbox
MkDocs plugin supports image lightbox with GLightbox.
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-glightboxuv
uv add mkdocs-glightboxpoetry
poetry add mkdocs-glightboxInstalling 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
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
mkdocs-drawioA MkDocs plugin that embeds interactive Drawio…
permissive · top 15,000 on PyPI
mkdocs-panzoom-pluginAdds interactive pan and zoom functionality to…
permissive · top 5,000 on PyPI
mkdocs-videoA MkDocs plugin that embeds videos in…
permissive · top 15,000 on PyPI
mkdocs-swagger-ui-tagA MkDocs plugin that embeds Swagger UI directly…
permissive · top 15,000 on PyPI
mkdocs-materialMaterial for MkDocs is a professional theme and…
permissive · top 5,000 on PyPI
mkdocs-awesome-pages-pluginA plugin for MkDocs that lets you customize…
permissive · top 5,000 on PyPI
mkdocs-kroki-pluginA MkDocs plugin that converts Kroki diagram…
permissive · top 15,000 on PyPI
mkdocs-print-site-pluginMkDocs plugin that generates a combined print…
permissive · top 15,000 on PyPI
mdformat-mkdocsAn mdformat plugin that formats Markdown for…
permissive · top 15,000 on PyPI
mkdocs-plugin-inline-svgA MkDocs plugin that replaces SVG image…
permissive · top 15,000 on PyPI