Back to portal

Median.co Set Sidebar/Tab Navigation Demo

App Only: To use this demo for testing open the current page within your Median.co app

                    [
    {
        "subLinks": [],
        "label": "Sample Contact",
        "url": "https://median.dev/sidebar-tab-demo/contact"
    },
    {
        "subLinks": [],
        "label": "Sample About",
        "url": "https://median.dev/sidebar-tab-demo/about"
    }
]
                    
                
                    {
    "tabSelectionConfig": [
        {
            "id": "1",
            "regex": "https://median.dev/sidebar-tab-demo/about.*"
        },
        {
            "id": "2",
            "regex": "https://median.dev/sidebar-tab-demo/contact.*"
        }
    ],
    "tabMenus": [
        {
            "items": [
                {
                    "subLinks": [],
                    "label": "Home",
                    "url": "https://median.dev/sidebar-tab-demo/index",
                    "icon": "fas fa-house"
                },
                {
                    "subLinks": [],
                    "label": "Contact Us",
                    "url": "https://median.dev/sidebar-tab-demo/contact",
                    "icon": "fas fa-envelope"
                }
            ],
            "id": "1"
        },
        {
            "items": [
                {
                    "subLinks": [],
                    "label": "Home",
                    "url": "https://median.dev/sidebar-tab-demo",
                    "icon": "fas fa-house"
                },
                {
                    "subLinks": [],
                    "label": "About Us",
                    "url": "https://median.dev/sidebar-tab-demo/about",
                    "icon": "fas fa-user"
                }
            ],
            "id": "2"
        }
    ],
    "active": true
}
                
                    median.tabNavigation.setTabs({
    "enabled": true, // set enabled to false to hide the tabs
    "items": [{
        "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')"
    }]
});
                
                    if (navigator.userAgent.indexOf('gonative') > -1 || navigator.userAgent.indexOf('median') > -1) {
    median.tabNavigation.selectTab(tabIndex); 
    // the tabs are 0-indexed
    // i.e. tabs/select/1 will select the second tab
}