Là một dự án frontend, sachinchoolur/lightGallery đã đạt 7.1k sao trên GitHub, ngôn ngữ TypeScript. A customizable, modular, responsive, lightbox gallery plugin.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
lightGallery is a JavaScript lightbox and gallery for images and video,
with native React, Vue and Angular packages. No dependencies, 15 plugins,
and the same features in every stack.
One gallery, four packages with the same features and settings:
Stack
Package
Vanilla JS / TypeScript
lightgallery
React
@lightgallery/react
Vue 3
@lightgallery/vue
Angular
@lightgallery/angular
The framework-free core they share is available on its own as
@lightgallery/headless.
Core features
Works everywhere
Plain JavaScript or TypeScript, plus native
React,
Vue 3 and
Angular packages. Same
features and settings in every stack.
No dependencies. Use it with a bundler or drop in a script tag.
Lightweight. Plugins are separate files, so you only load what you use.
15 plugins, and you can
write your own.
Easy to customize with CSS (or SCSS) and settings. Multiple galleries
on one page.
Layout and performance
Fully responsive, with the
right image size for every screen.
Justified layout:
thumbnails in tidy rows of equal height, no extra library needed.
Large galleries
with thousands of images stay fast.
Dynamic mode
builds a gallery from a list of items, and you can
add, edit or remove slides
while it is open.
Inline gallery and carousel modes.
Smart preloading of the next slides.
Interaction
Built for touch, with mouse drag on desktop. Swipes glide and settle
smoothly, like a native app.
Swipe, drag or pinch to close.
Zoom in and out, pinch to zoom, double-click or double-tap for actual
size. Slides
open from the thumbnail
and close back to it.
Animated thumbnails you can
scrub through.
20+ smooth CSS3 transitions, or bring your own.
Keyboard navigation and full screen support.
Fits small screens: extra toolbar buttons tuck into a "More" menu.
Accessible: works
with screen readers and keyboards, and respects reduced motion.
Localization and RTL:
translate every label, and the gallery mirrors for right-to-left pages.
Media and plugins
YouTube, Vimeo, Wistia and HTML5 video, with
lightweight previews
that load the player only when you press play.
Mixed content:
photos, videos, maps, iframes and PDFs in one gallery.
HTML captions for
every slide.
Rotate and flip images.
Share through the
phone's share sheet, or social links on desktop.
Deep links: every
slide gets its own URL, and the browser back button works.
Autoplay slideshow with a progress bar, pager dots, comments, and a
medium-zoom
plugin for zooming images in place.
SVG icons you can
replace with your own.
Documentation
Getting started
Settings,
events and
methods
React,
Vue,
Angular and the
headless core
Accessibility
Migrating from v2
Troubleshooting
Demos
Every docs page has a markdown twin at the same URL plus index.md, and
llms.txt indexes them all.
For coding agents
llms.txt lists every docs
page in markdown, one request each.
The getting-started guide
has a prompt to paste into an agent. It picks the right package for the
stack, imports the CSS, adds the zoom and thumbnail plugins and sets
lgSize on every item.
This repository ships an agent skill at
skills/lightgallery/SKILL.md that
teaches the same workflow for all four stacks.
Installation
lightGallery is available on NPM, Yarn, CDNs, and GitHub. You can use any
of the following methods to download lightGallery.
NPM - NPM is a package manager for the JavaScript
programming language. You can install lightgallery using the following
command
npm install lightgallery
YARN - Yarn is another popular package manager for
the JavaScript programming language. If you prefer you can use Yarn instead
of NPM
yarn add lightgallery
GitHub -
You can also download a release directly from GitHub
CDN - If you prefer to use a CDN, you can load files via
jsdelivr,
cdnjs or
unpkg
Include CSS and Javascript files
First of all, include lightgallery.css in the <head> of the document. If
you want include any lightGallery plugin such as thumbnails or zoom, you need to
include respective css files as well.
Alternatively you can include lightgallery-bundle.css which contains
lightGallery and all plugin styles instead of separate stylesheets.
If you like you can also import scss files instead of css files from the scss
folder.
Then include lightgallery.umd.js into your document. If you want to include
any lightgallery plugin you can include it after lightgallery.umd.js.
<body>
....
<script src="lightgallery.umd.js"></script>
<!-- Or use the minified version -->
<script src="lightgallery.min.js"></script>
<!-- lightgallery plugins -->
<script src="plugins/thumbnail/lg-thumbnail.umd.js"></script>
<script src="plugins/zoom/lg-zoom.umd.js"></script>
</body>
lightGallery supports AMD, CommonJS and ES6 modules too.
import lightGallery from 'lightgallery';
// Plugins
import lgThumbnail from 'lightgallery/plugins/thumbnail'
import lgZoom from 'lightgallery/plugins/zoom'
The markup
lightgallery does not force you to use any kind of markup. you can use whatever
markup you want.
Here can find
detailed examples of different kinds of markups.
Give each anchor the natural size of its full image via
data-lg-size="${width}-${height}". It drives the
zoom-from-origin
animation: the slide opens from the clicked thumbnail and closes back to it.
Without the attribute the slide fades in instead.
lightGallery works in all modern browsers: Chrome, Edge, Firefox and
Safari on desktop, Safari on iOS and Chrome on Android, with no build
step needed. Internet Explorer is not supported; lightGallery v2
remains available for it.
Use it with a bundler, as a native ES module, or from a plain script
tag.
Newer browser features, such as the phone's share sheet, are used where
available and fall back gracefully elsewhere.
If something misbehaves in a browser you care about, please
open an issue with
the browser and version.
License
Is lightGallery free? Yes. Every package and every plugin is free and
open source under the GPLv3, for personal and commercial
projects alike, as long as your project is distributed under
GPLv3-compatible terms.
If you want to keep your own source proprietary, choose the
commercial license. It covers the
same code with every feature and plugin included, nothing is gated, and it
is a one-time payment. See LICENSE-COMMERCIAL.md.
Support
If the gallery misbehaves, the
troubleshooting guide
covers the symptoms behind most bug reports, with the fix for each package.
If you have any questions, suggestions, feedback, please reach out to
[email protected] or DM me on
X
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/sachinchoolur/lightGallery là nguồn chính thức.
sachinchoolur/lightGallery có phải mã nguồn mở không?
Có — sachinchoolur/lightGallery phát hành theo license GPL-3.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/sachinchoolur/lightGallery.
sachinchoolur/lightGallery có trang demo không?
Dự án có trang chủ ở https://www.lightgalleryjs.com/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
sachinchoolur/lightGallery còn đang phát triển không?
Commit gần nhất trên sachinchoolur/lightGallery là 3 tháng trước (theo timestamp GitHub). Repo có 1.3k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
sachinchoolur/lightGallery dùng license gì?
sachinchoolur/lightGallery phát hành theo license GPL-3.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc đầy đủ README ở tab phía trên.
lightGallery có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về lightGallery.