> For the complete documentation index, see [llms.txt](https://docs.digitalsamba.com/reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalsamba.com/reference/sdk/methods/toggletopbar.md).

# 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()](/reference/sdk/methods/hidetopbar.md) and [showTopbar() ](/reference/sdk/methods/showtopbar.md)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.
