> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic tab menu

> Select, deselect, set, and hide bottom tab menu items at runtime from your website with the Median JavaScript Bridge.

A default tab menu can be defined in the app configuration and can be overwritten dynamically as required. 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.

## Implementation guide

### Select a tab

Median JavaScript Bridge

```javascript JavaScript  theme={null}
median.tabNavigation.selectTab(1); 
```

**Note:** Tabs are 0-indexed, so `median.tabNavigation.selectTab(1)` selects the second tab.

**Parameters**

**index** `number` *required*

Position of the tab to select, starting at `0`. Pass it as the only argument.

### Deselect all tabs

Median JavaScript Bridge

```javascript JavaScript  theme={null}
median.tabNavigation.deselect(); 
```

### Set or change the tab buttons

Median JavaScript Bridge

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

**Parameters**

**enabled** `boolean`

Set to `true` to show the tab menu, or `false` to hide it.

**items** `object[]`

The tabs to show. These replace the current tabs.

**properties**

**label** `string` *required*

Text shown on the tab.

**url** `string` *required*

Page to open when the user taps the tab, or a `javascript:` URL to run code instead.

**icon** `string`

A Font Awesome icon class, for example `fas fa-globe`.

### Hide the tab menu

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.tabNavigation.setTabs({'enabled': false});
```


## Related topics

- [Localized tab menu](https://docs.median.co/docs/localized-tab-menu.md)
- [Dynamic menu items](https://docs.median.co/docs/dynamic-menu-items.md)
- [Bottom tab bar Visual Editor](https://docs.median.co/docs/tab-configuration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.