React Image Grid Gallery v3.1.0 Release
React Image Grid Gallery version 3.1.0 is out! 🥳
Notable Changes
- Thumbnails: Preview images at the bottom of the lightbox.
- Image captions: Show the lightbox image’s description.
- Lazy loading: Speed up initial page load and reduce network usage by deferring the loading of non-blocking (non-critical) images.
- Resolution switching: Save bandwidth by giving the browser hints about the appropriate lightbox image resolution based on the user’s screen width.
Updated / New Props
Props | Type | Default | Description |
---|---|---|---|
imagesInfoArray | array | undefined | (Required) An array of objects containing the following properties:
|
thumbnailBorder | string | "3px solid #fff" | (Optional) The thumbnail’s border style. |
lazy | boolean | true | (Optional) Specify whether to lazy load images. |
lazyFromIndex | number | 6 | (Optional) The image’s index to begin the grid’s lazy loading. Tip: Use a negative number to lazy load all the images. |
customStyles | ImageGalleryStylesType | {} | (Optional) Custom styles to override the following element’s default styles:
|
How to Update the React Image Grid Gallery Package
npm install react-image-grid-gallery@latest
Alternatively, you can use Yarn or pnpm like so:
yarn upgrade react-image-grid-gallery --latest
pnpm update react-image-grid-gallery --latest
How to Use the React Image Grid Gallery Package
See the complete project-based guide to learn how to add the ImageGallery
package to your React applications. You can use the library with Vite, NextJS, Remix, or any other React app.