# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalsamba.com/reference/sdk/methods/toggletopbar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
