Dynamic Tab Menu

📘

Similar to the Sidebar Navigation Menu, tab menu items can also be loaded dynamically from your website using the GoNative Javascript Bridge. The tab menu items can be loaded on specific pages or subsequent to events such as a user login flow.

A default tab menu can be defined in the app configuration that is then overwritten dynamically as required. Or alternatively, the configuration can be left blank and all tab menus set by the website. The visibility of the tab menu can also be toggled dynamically at runtime.

↔️GoNative JavaScript Bridge

Select a tab:

    gonative.tabNavigation.selectTab(1);

Note: The tabs are 0-indexed, i.e. gonative.tabNavigation.selectTab(1) will select the second tab

Deselect all tabs:

    gonative.tabNavigation.deselect();

Set/change the tab buttons:

var tabItems = [{
              "icon": "fas fa-cloud", //optional
              "label": "Tab 1",
              "url": "javascript:alert('You selected tab 1')"
          }, {
              "icon": "fas fa-globe", //optional
              "label": "Tab 2",
              "url": "javascript:alert('You selected tab 2')"
          }, {
              "icon": "fas fa-users", //optional
              "label": "Tab 3",
              "url": "javascript:alert('You selected tab 3')"
          }];
gonative.tabNavigation.setTabs({'enabled': true, 'items': tabItems});

Hide the tab menu:

gonative.tabNavigation.setTabs({'enabled': false});

Next Steps