Product Gallery in React (video tutorial)
Last updated: Sep-12-2024
On this page:
Overview
With the Product Gallery, Cloudinary has created an easy way to dynamically display your images, videos, 3D models and 360 animations/spin sets on your website! This tutorial teaches you how to embed the gallery in a React app.
Video tutorial
View the code
You can find the code from this tutorial in GitHub.Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Add the Product Gallery script
To add the Product Gallery to your app, first add the Product Gallery script to the index.html file. |
Initialize the Product Gallery within a useEffect
Initialize the Product Gallery within a useEffect linked to the window, and calling the gallerywidget method. |
Set the Product Gallery options
Configure the gallery with your cloud name, a container reference, and the assets to display by providing a tag common to them all. |
Add a tag to multiple assets
You can select multiple assets in the Media Library and add a tag to them all. |
Enable resource lists
Make sure that resource listing is enabled in your Restricted media types settings. |
Use the render method to display the Product Gallery
Use the render method to display the Product Gallery. |
Customize the Product Gallery
Customize the Product Gallery by changing the appearance of the widget including changing the aspect ratio, adding video assets, and changing the carousel navigation icons to indicators on the bottom. |
Keep learning
Related topics
- Learn more about the Product Gallery.
- Take a look at our Transformations guide to learn about transforming images in general.
- Use the Product Gallery reference to find all the options and parameters available for the Product Gallery.
- Watch more Dev Hints videos on the Cloudinary YouTube channel.
If you like this, you might also like...
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
✖️