[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109178":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":44,"updatedAt":45,"readmeContent":46,"aiSummary":47,"trendingCount":15,"starSnapshotCount":15,"syncStatus":48,"lastSyncTime":49,"discoverSource":50},109178,"liftbox","esdrassantos06\u002Fliftbox","esdrassantos06","Accessible, themeable React lightbox and gallery with zoom, video, slideshow and deep links. Zero runtime dependencies.","https:\u002F\u002Fliftbox.digital",null,"TypeScript",58,10,51,0,1,25,46.12,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"accessibility","gallery","image-gallery","image-viewer","image-zoom","justified-gallery","lightbox","masonry","nextjs","photo-gallery","photo-viewer","photoswipe-alternative","react","react-component","react-lightbox","slideshow","ssr","typescript","video","zoom","2026-11-23 07:26:43","2026-11-22 08:22:03","\u003Cp align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\".\u002Fassets\u002Flogo\u002Flogo-dark.svg\" \u002F>\n    \u003Cimg src=\".\u002Fassets\u002Flogo\u002Flogo-light.svg\" alt=\"liftbox\" width=\"220\" \u002F>\n  \u003C\u002Fpicture>\n\u003C\u002Fp>\n\n# liftbox\n\n[![CI](https:\u002F\u002Fgithub.com\u002Fesdrassantos06\u002Fliftbox\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fesdrassantos06\u002Fliftbox\u002Factions\u002Fworkflows\u002Fci.yml)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fliftbox)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fliftbox)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-black)](.\u002FLICENSE)\n[![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fesdrassantos06\u002Fliftbox?style=social)](https:\u002F\u002Fgithub.com\u002Fesdrassantos06\u002Fliftbox)\n\n**[Documentation and live demos](https:\u002F\u002Fliftbox.digital)** · [Try it on StackBlitz](https:\u002F\u002Fstackblitz.com\u002Fgithub\u002Fesdrassantos06\u002Fliftbox\u002Ftree\u002Fmain\u002Fexamples\u002Fvite?file=src%2FGallery.jsx) · [Comparison with other React lightboxes](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fcomparison)\n\nA React lightbox that opens each photo out of the thumbnail you clicked, even a cropped one, and flies it back on close. Zoom, video, thumbnails, slideshow and masonry or justified grids ship in one MIT package with zero runtime dependencies; you can swap every string, icon, color and timing, and it works with any grid you already have.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\".\u002Fassets\u002Fdemo.gif\" alt=\"A photo in a justified grid is clicked, lifts out of its thumbnail into the lightbox, moves to the next photos and flies back into the grid on close.\" width=\"720\" \u002F>\n\u003C\u002Fp>\n\nUsing liftbox? A star on GitHub is how the next person searching for a React lightbox finds it.\n\n## Features\n\n- Open and close animation from your thumbnail, with a zoom and fade fallback.\n- Arrows, keyboard, swipe and flick navigation, with `slide`, `fade` and `zoom` transitions.\n- Thumbnail strip or pager dots, zoom (wheel, pinch, double tap, buttons, keys), pinch to close, fullscreen, rotation, flip, sharing and downloads.\n- A toolbar that moves what does not fit into an accessible \"More options\" menu, controls that fade out when idle, and right-to-left layouts.\n- Native video with captions, YouTube and Vimeo without their player scripts, any page in an iframe, and room for [custom players](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fcustom-players) such as Video.js 10.\n- Slideshow that pauses when the user takes over.\n- AVIF, WebP and art-directed crops through `\u003Cpicture>` sources on image slides.\n- Fast with thousands of images and videos: the current image loads first with its thumbnail as a placeholder, preloading adapts to slow connections, and the thumbnail strip, pager and grids render only what is in view.\n- Optional [justified, masonry and uniform grids](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fgrids) and a [category filter](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Ffilter), each usable with or without the lightbox.\n- Deep links through the URL hash with `useLightboxHash`, by number or by slide name, closed by the back button.\n- Modal dialog semantics, focus trap and return, a live region, reduced motion and a scroll lock that keeps the page still.\n- Server-rendering safe, ready for the Next.js App Router.\n- Styled with `--eg-*` CSS variables. The lightbox needs no `'unsafe-inline'` in a Content Security Policy.\n\n## Compared with other React lightboxes\n\n|                            | liftbox                     | yet-another-react-lightbox | PhotoSwipe | lightGallery               |\n| -------------------------- | --------------------------- | -------------------------- | ---------- | -------------------------- |\n| License                    | MIT                         | MIT                        | MIT        | GPL-3.0 or a paid license  |\n| Opens out of the thumbnail | Yes, also cropped ones      | No                         | Yes        | Yes, cropped with a plugin |\n| Grids                      | Masonry, justified, uniform | Separate package           | No         | Justified                  |\n| Zoom, thumbnails, video    | Built in                    | One plugin each            | Zoom only  | One plugin each            |\n| YouTube and Vimeo          | Built in                    | No                         | No         | Plugin                     |\n\nMeasured bundle sizes, pinned versions, sources and an accessibility table are on the [comparison page](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fcomparison), with migration guides from [yet-another-react-lightbox](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fmigration), [lightGallery](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fmigration-lightgallery) and [PhotoSwipe](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fvs-photoswipe).\n\n## Installation\n\n```bash\nnpm install liftbox\n```\n\n```ts\nimport \"liftbox\u002Fstyles.css\";\n```\n\nReact 18 or 19 is a peer dependency. The package is ESM only and ships TypeScript declarations.\n\n## Quick start\n\nThe lightbox is controlled: you own `open` and `index`, it tells you when the user wants to change them. Keep it mounted so the close animation can play.\n\n```tsx\nimport { useRef, useState } from \"react\";\nimport { Lightbox, type Slide } from \"liftbox\";\nimport \"liftbox\u002Fstyles.css\";\n\nconst slides: Slide[] = [\n  {\n    src: \"\u002Fphotos\u002Fharbour.jpg\",\n    width: 1600,\n    height: 1067,\n    alt: \"Boats in the harbour\",\n    title: \"Harbour\",\n  },\n  \u002F\u002F ...\n];\n\nexport function Gallery() {\n  const [index, setIndex] = useState(-1);\n  const thumbnails = useRef\u003C(HTMLButtonElement | null)[]>([]);\n\n  return (\n    \u003C>\n      {slides.map((slide, i) => (\n        \u003Cbutton\n          key={slide.src}\n          ref={(el) => {\n            thumbnails.current[i] = el;\n          }}\n          onClick={() => setIndex(i)}\n          aria-label={`Open ${slide.alt}`}\n        >\n          \u003Cimg src={slide.src} alt=\"\" width={200} height={133} \u002F>\n        \u003C\u002Fbutton>\n      ))}\n\n      \u003CLightbox\n        slides={slides}\n        open={index >= 0}\n        index={Math.max(index, 0)}\n        onIndexChange={setIndex}\n        onClose={() => setIndex(-1)}\n        getThumbnail={(i) => thumbnails.current[i]}\n      \u002F>\n    \u003C\u002F>\n  );\n}\n```\n\n## Documentation\n\nThe full documentation, with live demos on every page, is at **[liftbox.digital](https:\u002F\u002Fliftbox.digital\u002Fdocs)**.\n\n| Topic           | Pages                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Getting started | [Installation](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Finstallation), [Quick start](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fquick-start), [Next.js App Router](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fnextjs), [Server rendering](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fssr)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| Features        | [Slides](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fslides), [Navigation and gestures](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fnavigation), [Thumbnails](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fthumbnails), [Pager dots](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fpager), [Zoom](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fzoom), [Fullscreen](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Ffullscreen), [Slideshow](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fslideshow), [Deep linking](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fdeep-linking), [Rotation](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Frotation), [Flip](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fflip), [Download](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fdownload), [Share](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fshare), [Toolbar and overflow menu](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Ftoolbar), [Idle controls](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fidle), [Right-to-left](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Frtl), [Custom players](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fcustom-players), [Grids](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fgrids), [Category filter](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Ffilter) |\n| Customising     | [Labels and i18n](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Flabels), [Icons](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Ficons), [Render overrides](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Frender), [Styling](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fstyling), [Class names and data attributes](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fclass-names)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| Reference       | [Lightbox props](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Flightbox-props), [Slide](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fslide), [Exports](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fexports)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| Guides          | [Accessibility](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Faccessibility), [Content Security Policy](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fcsp), [Performance](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fperformance), [Bundle size](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fbundle-size), [Comparison](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fcomparison), [Migrating from yet-another-react-lightbox](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fmigration), [Migrating from lightGallery](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fmigration-lightgallery), [liftbox vs PhotoSwipe](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fvs-photoswipe)                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n\nThe source of the docs lives in [`docs\u002F`](.\u002Fdocs), and the prop tables there are generated from [`src\u002Ftypes.ts`](.\u002Fsrc\u002Ftypes.ts).\n\n## Bundle size\n\n[![Lightbox size](https:\u002F\u002Fimg.shields.io\u002Fbundlejs\u002Fsize\u002Fliftbox?exports=Lightbox&externals=react,react-dom&label=Lightbox)](https:\u002F\u002Fbundlejs.com\u002F?q=liftbox&treeshake=[{Lightbox}])\n[![Package size](https:\u002F\u002Fimg.shields.io\u002Fbundlejs\u002Fsize\u002Fliftbox?externals=react,react-dom&label=everything)](https:\u002F\u002Fbundlejs.com\u002F?q=liftbox)\n\nMinified and gzipped by [bundlejs](https:\u002F\u002Fbundlejs.com) from the version on npm, React excluded. The [Bundle size](https:\u002F\u002Fliftbox.digital\u002Fdocs\u002Fbundle-size) page lists every entry, minified and brotli-compressed with `npm run size` each time the docs are built.\n\n## Development\n\n| Script                  | What it does                                      |\n| ----------------------- | ------------------------------------------------- |\n| `npm run dev`           | Playground on Vite, also used by the e2e tests    |\n| `npm run test`          | Unit and integration tests (Vitest, jsdom)        |\n| `npm run e2e`           | Playwright on desktop Chrome and Pixel 7          |\n| `npm run typecheck`     | TypeScript, including isolated declaration checks |\n| `npm run lint`          | ESLint with React Hooks and jsx-a11y              |\n| `npm run build`         | ESM bundle, declarations and stylesheet in `dist` |\n| `npm run size`          | Bundle size                                       |\n| `npm run check:package` | publint and Are the Types Wrong                   |\n\nThe public site, with the docs and demos, lives in [`docs\u002F`](.\u002Fdocs) (Next.js and Fumadocs) and has its own scripts: `npm run dev --prefix docs` and `npm run build --prefix docs`. It runs as a Next.js server on Vercel, with `docs` as the project's root directory. [`docs\u002Fproxy.ts`](.\u002Fdocs\u002Fproxy.ts) gives every page a fresh nonce and a Content Security Policy with `default-src 'self'` that trusts only scripts and style tags carrying that nonce.\n\n## Migrating from @esdrassantos06\u002Fgallery\n\nThis package was published as `@esdrassantos06\u002Fgallery` until 1.2.0. Moving over takes one install and two import paths: the API, class names and `--eg-*` variables did not change.\n\n## Contributing\n\nContributions are welcome. Read [CONTRIBUTING.md](.\u002FCONTRIBUTING.md) and the [Code of Conduct](.\u002FCODE_OF_CONDUCT.md), and report vulnerabilities as described in [SECURITY.md](.\u002FSECURITY.md). Changes are listed in [CHANGELOG.md](.\u002FCHANGELOG.md).\n\n## License\n\n[MIT](.\u002FLICENSE). The justified layout math is adapted from opengallery and the built-in icons are from [Mynaui Icons](https:\u002F\u002Fmynaui.com\u002Ficons), both MIT. Their notices are in [NOTICE](.\u002FNOTICE).\n","liftbox 是一个专为 React 应用设计的无障碍、可主题化的图片\u002F视频灯箱与画廊组件。它支持从缩略图平滑飞入式打开、缩放（滚轮\u002F双击\u002F手势）、视频嵌入（含 YouTube\u002FVimeo 无脚本加载）、幻灯片播放、深度链接（URL hash）、SSR 友好及零运行时依赖。组件完全用 TypeScript 编写，内置焦点管理、屏幕阅读器支持、RTL 布局和自定义图标\u002F文案\u002F动效，兼容任意现有网格布局（如 masonry、justified）。适用于需要高性能、高可访问性且需深度定制的图片展示场景，如作品集网站、电商图册、新闻图集或企业级内容平台。",2,"2026-11-24 04:36:06","CREATED_QUERY"]