# toggleToolbar()

Toggles the application toolbar visibility state.&#x20;

If the toolbar is currently shown, then it will be hidden. And vice-versa -> if the toolbar is currently hidden, then it will be shown. There is also an optional param to set a concrete target visibility state, but you may use [hideToolbar()](https://docs.digitalsamba.com/reference/sdk/methods/hidetoolbar) and [showToolbar()](https://docs.digitalsamba.com/reference/sdk/methods/showtoolbar) to achieve similar functionality.

```javascript
//This will toggle the toolbar visibility state
sambaFrame.toggleToolbar();

//This will show the toolbar, equivalent to sambaFrame.showToolbar();
sambaFrame.toggleToolbar(true); 

//This will hide the toolbar, equivalent to sambaFrame.hideToolbar();
sambaFrame.toggleToolbar(false);
```

**Sample use case**: \
You may have a button in your application to control the toolbar visibility.
