# toggleTopbar()

Toggles the application topbar visibility state (which includes the logo and tile mode switcher).&#x20;

If the topbar is currently shown, then it will be hidden. And vice-versa -> if the topbar 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 [hideTopbar()](https://docs.digitalsamba.com/reference/sdk/methods/hidetopbar) and [showTopbar() ](https://docs.digitalsamba.com/reference/sdk/methods/showtopbar)to achieve similar functionality.

```javascript
//This will toggle the topbar visibility state
sambaFrame.toggleTopbar();

//This will show the topbar, equivalent to sambaFrame.showTopbar();
sambaFrame.toggleTopbar(true); 

//This will hide the topbar, equivalent to sambaFrame.hideTopbar();
sambaFrame.toggleTopbar(false);
```

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