jig.gallery
The jig.gallery provides a way to browse and swipe through a collection of images. This gallery fetches data dynamically from a datasource and presents each image as a gallery item, allowing users to view, share, or delete each item. This control is ideal for showcasing visual collections with interactive features, such as product catalogs or job-related images.

Usage
Use the gallery component when you need to:
Display a collection of images from a datasource.
Allow users to interact with each item (e.g., share, delete, or navigate).
Tap on a thumbnail to view the image in fullscreen mode. The selected image opens with share and delete icons visible.
Supports horizontal swiping to scroll through multiple images. The total image count is displayed at the top.
Pinch and zoom on the current image for detailed viewing.
Close the full screen view fullscreen view by swiping down or tapping the back arrow.
Configuration options
The jig.gallery creates a gallery layout from a datasource. The YAML structure is similar in configuration to the jig.list or jig.grid where a single gallery-item is configured and iterates through the datasource. Some properties are common to all jig types, see Common jig type properties for a list and their configuration options.
title
Give the jig a title that is displayed at the top of the screen. If you do not want to show a title in a jig use title: ' '.
type
Specifies the control type. Here, it is set to jig.gallery for a gallery view.
item
Within a gallery jig type, the gallery-item component is used to define each of the elements in the layout, configured under the imageUri property.
datasources
Configure a datasource to call the image data to display in the gallery. The datasource property is required. Depending on the datasource, conversions might be required.
data
Binds the gallery data to the results from the datasource.
actions
Choose from the provided list of available actions, for example, use the go-to action to open a different jig.
badge
Enhance your tabs with a badge, for instance show the number of grid-items. Add the badge property to the jig YAML with an expression.
bottomSheet
The bottomSheet element slides up from the bottom of the screen to present additional content, actions, or contextual information.
expressions
Use the expressions property to set that are reusable throughout the jig.
header
Configure a that displays and image, location or video at the top of the jig.
icon
The icon will be displayed on the of the jig. Start typing the name of the icon to invoke the available list in IntelliSense. See Jigx icons for information on working with icons. The icon property applies to component.jig-widget without a widgetId. See the considerations below for the rules governing icon behavior.
inputs
Configure that allow you to receive data from other jigs and use it in the current jig.
isWaitingSync
Displays a waiting sync indicator.
jigId
Give the jig a unique id that can be referenced outside the jig, for example in state expressions.
outputs
Configure that allow you to transfer data out of the current jig and use it in another jig.
placeholders
Create a placeholder to show when there is no data to use yet. See tips and tricks -use a placeholder for a placeholder example.
summary
Add a component that displays at the bottom of the jig.
title
By default, the jig's title is displayed on the widget. You can override it by adding the title property to the component.jig-widget in the grid-item, either with a custom title or with '' (a blank space) to remove the title entirely.
widgets
Configure the widgets property to display the content from this jig on the home hub or another jig (screen).
onSharePress
Add an action directly on the gallery-item, such as action.share which lets you quickly send the image via the apps on the device, such as email, messaging apps, or AirDrop.
onDeletePress
Add an action directly on the gallery-item that will execute when the image delete, such as execute-entity to delete the image frm the datasource.
state
You can set the initial value of state and then use it anywhere in context of the jig by [email protected].[key]
Considerations
The
OnSharePressaction displays as a share icon in the bottom-left corner of the image. Tapping it opens the device’s sharing options (e.g., email, messaging apps, AirDrop).TheOnSharePressaction must be explicitly defined in the YAML for the icon and its behavior to appear.The
OnDeletePressaction, displays as a trash icon in the bottom-left corner. Tapping it removes the image from both the gallery and its datasource according to the configured actions. TheOnDeletePressaction must be explicitly defined in the YAML for the icon and its behavior to appear.If both the
onSharePressandonDeletePressactions are configured the share icon stays in the bottom-left, and the delete icon shifts to the bottom-right.The
jig.galleryis not supported inside a composite jig.Consider when and how images are loaded in the gallery. Use server-generated thumbnails to keep the gallery fast and bandwidth-efficient. Download and cache full images (via localPath) when high quality is needed, for offline access, or to reduce repeated network requests. This approach balances performance with quality and resource efficiency.
Examples and code snippets
Basic gallery jig
This example shows how to configure a jig.gallery component to pull photos of job-site tasks from a Dynamic Data source and display them in a scrollable gallery. Users can tap the open-media-picker action to capture or select new images, which are then saved back to the same datasource and appear instantly in the gallery.
Example:
The full example can be seen in GitHub.

Gallery jig with onSharePress and onDeletePress

This example demonstrates how to configure the onSharePress and onDeletePress actions that allow users to share or delete images when tapping on an image in the gallery. The image opens in fullscreen, with share and delete icons displayed at the bottom, providing quick and intuitive interaction with each image.
Example: The full example can be seen in GitHub.
Gallery jig with REST datasource conversions
This example retrieves customer details and images from a REST endpoint and displays them in a list. Swiping left on a customer triggers an onPress event that opens a jig.gallery, showing all images associated with that customer. You can add more images using the Add Image button. The configured GET and POST REST functions handle the necessary conversions, transforming images to the format expected by the REST service and converting them back for use in the app.

Gallery jig with a bottomSheet
This example shows a jig.gallery configured with a bottomSheet that slides up from the bottom of the screen to display additional information about the related appointment. The bottomSheet uses the jigId property with a go-to action to open the appointments jig, providing a view of the appointment associated with the images.
Example:
The full example is in GitHub.

Gallery jig in a tab jig

In this example, jig.gallery is used as a tab within a jig.tabs screen. The tab, labeled Task Photos, displays a gallery of images related to appointments. Tapping an image opens it in fullscreen, where you can access the share and delete action icons at the bottom. The fullscreen view also supports pinch-and-zoom to explore image details.
Example: The full example is available on GitHub.
Last updated
Was this helpful?