An image gallery is a great way to showcase your work, whether that’s screenshots of your app, artistic photos you’ve taken, or example photos of an item on sale. The Gallery component makes it easy to add an image gallery to your app or website.
When an image in the Gallery component is clicked by the user, it will enlarge in a Lightbox, letting the user get a closer look. You can optionally label and number the images, adjust fade in timing, and set the image resize duration.
Installing custom components from Backendless Marketplace is super easy. First, in UI Builder, select the Components tab.
There, you will see a button labeled Install Component. This will take you to the library of components available in the Marketplace.
When you click Install Component, you will open a list of available UI Components to install.
Select the component you want and click Install.
When you return to the User Interface tab, you will see a new section added to your toolkit on the right-hand side called Custom Components.
You can then simply drag the component onto your canvas just like any other UI Component.
How the Gallery Component Works
When added to your app, the Gallery component offers several basic functions out of the box.
First, you can set the images in the gallery manually by including URLs of the images to include. These URLs can be on external sites, or images stored in your Backendless File Storage.
Alternately, you can use Codeless logic to set the images to display, making it easy to dynamically set the content included in the Gallery.
Next, you can choose whether or not the gallery will “end” using the Wrap Around property. When checked, upon reaching the end of the gallery, if the user clicks onto the next image, it will return them to the start of the gallery.
You can enable or disable navigation on mobile. If you don’t want mobile users to be able to navigate between images on mobile, that capability can easily be switched off.
Disable scrolling allows you to prevent the page behind the Lightbox from scrolling while an image is open. This can help ensure that user’s don’t accidently lose their place on a page, especially if there are multiple galleries on the page.
Next, you can choose whether or not to have the images in the gallery numbered, as well as adjusting the labels for this numbering.
Finally, you have control over the duration it takes for the Lightbox and image to fade in on the screen. You can also adjust the time it takes for the Lightbox to resize when transitioning between images with different dimensions.
Available Options and What They Mean
Once you have placed your component, when you select it, you will see all of the available options (properties) for the component in the toolkit area. These are the default settings for the component that you can easily adjust.
Each of the available properties are described in the table below. For more information, such as Theme styles and event handlers, visit the Gallery GitHub repo.
This checkbox toggles the ability to make the gallery infinite. If checked, when a user reaches the last image in a set, the right navigation arrow will appear and they will be to continue moving forward, which will take them back to the first image in the set.
Nav On Mobile
This checkbox toggles the visibility of the navigation on touchscreen devices. If true, the left and right navigation arrows which appear on mouse hover when viewing image sets will always be visible on devices which support touch.
This checkbox toggles scroll possibility. If true, prevent the page from scrolling while Lightbox is open. This works by setting overflow hidden on the body.
Show Image Number Label
This checkbox toggles the visibility of the number of images. If unchecked, the text indicating the current image number and the total number of images in the set (Ex. “image 2 of 4”) will be hidden.
This option is to set the text in indicator of images. It works if “Show Image Number Label” is true.
This option is to set separator in indicator of images. It works if “Show Image Number Label” is true.
This option is to set the time of fade duration. The time it takes for the Lightbox container and overlay to fade in and out, in milliseconds.
Image Fade Duration
This option is to set the time of image fade duration. The time it takes for the image to fade in once loaded, in milliseconds.
This option is to set the time it takes for the Lightbox container to animate its width and height when transition between different size images, in milliseconds.
Position From Top
This option is to set the distance from top of the viewport that the Lightbox container will appear, in pixels.
When you click on the Logic icon or tab for the component, you will see the modifiable event handlers, just as you would with a standard component. However, the main logic for the component – the logic that makes it work – is hidden to protect it from accidentally being broken.
Additionally, in the Logic area, you will also find all available data binding properties.
That’s it! Ready to try it for yourself?
The Gallery component is one of many custom components available now in Backendless Marketplace, completely free!
Start Building Your Perfect UI
Start your free 30-day trial today to get access to the full library of UI components, plus the most powerful Codeless backend available. What are you waiting for?
[vc_row][vc_column][vc_column_text] Notify your users when actions succeed, fail, require further attention, or trigger any other information that the user needs to know by using the Snackbar component. The Snackbar component, available free in Backendless Marketplace, lets you display simple error, success, info, and warning notifications to your UI. These notifications can take multiple preset forms,…
[vc_row][vc_column][vc_column_text] Give your users the power to add and remove items from a fixed list with the Transfer List component in UI Builder. The Transfer List component, available free in Backendless Marketplace, lets the user select any or all items in a pre-set list and move them into a new list. The user can also…
[vc_row][vc_column][vc_column_text] Modals are popups that allow you to collect data from users, alert users to information, and allow users to perform other tasks in your UI without leaving the page they're on. The Simple Modal component, available free in Backendless Marketplace, lets you easily implement modal functionality in your UI Builder application. The component offers…