Creating a Home Hub
Creating a home screen (hub) for a mobile app can be a great way to enhance the user experience and provide more functionality. In this section, we will explore the benefits of creating a home screen and the steps involved in configuring one.
How to create a Home Hub
Steps to customize your Home Hub:
Create and configure a jig with the functionality and style that you require on the Home Hub. The jig.default or jig.grid are great options to use.
Use IntelliSense (ctrl+space) to open the list of available options in the index.jigx file, and select
tabs.In the
jigIdproperty, use IntelliSense again to choose the jig you configured as your Home Hub.Optional - Choose an icon that will represent the Home Hub. The selected icon is displayed as the first icon in the navigation bar at the bottom of the app.
Add the
onLoadoronRefreshevents for syncing data.You can configure additional
tabsby repeating the steps above.
Example and code snippet
Single jig Home Hub
Here is an example of a Home Hub designed for its simplicity. A jig.default is used with a component.image and component.list.

name: Expo
title: Expo
category: business
# Data is synced in the index.jigx file.
onLoad:
type: action.sync-entities
options:
provider: DATA_PROVIDER_DYNAMIC
entities:
- default/events
# Use the tabs property to reference the jig you want as the home screen.
# Select an icon for the jig in the bottom navigation bar.
tabs:
- jigId: yoga-wellness
icon: home-apps-logo# To hide any title use ' ' in the title field
title: ' '
type: jig.default
datasources:
yoga:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_DYNAMIC
entities:
- default/events
query:
SELECT
id,
'$.EventName',
'$.StartDate',
'$.Time',
'$.Venue',
'$.Type'
FROM [default/events] WHERE '$.Type' = 'Yoga'
children:
- type: component.image
options:
height: 300
resizeMode: cover
source:
uri: https://images.unsplash.com/photo-1524901548305-08eeddc35080?w=700&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8Y2FsbXxlbnwwfHwwfHx8MA%3D%3D
- type: component.list
options:
data: [email protected]
item:
type: component.list-item
options:
title: [email protected]
subtitle: =(@ctx.current.item.Venue & ' ' & @ctx.current.item.StartDate & ' ' & @ctx.current.item.Time)
rightElement:
element: button
title: Book
onPress:
type: action.go-to
options:
linkTo: contactsHome Hub with multiple components & widgets

In this example a jig.default is created with a component.image , component.section, component.countdown and component.grid. The grid component references four jigs and shows them as widgets that when tapped opens the jigs
Home Hub with multiple tabs in bottom navigation bar
In this example, four jigs are created. In the index.jigx file, they are configured in the tabs properties, which generates the custom bottom navigation bar.

Best practice
Adding videos directly to the Home Hub should be avoided if possible, instead add a gallery of images that when tapped open a jig with the video, use grid-item to create the gallery.
Consider what you add to the Home Hub as it could impact the app's performance, for example, long lists with data.
The
onloadevent must be configured on the index.jigx file for syncing data to the device.When deciding on the type of jig to use as the Home Hub it is recommended to use the jig.default or jig.grid as they provide the broadest scope of components, actions, and widgets.
Last updated
Was this helpful?