# SideBarToggleButton Object

> The sidebar toggle button shown at the top right of the ribbon.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > SideBarToggleButton Object
- **537 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/llms-full.txt

---

### Description

The sidebar toggle button shown at the top right of the ribbon.

### Syntax

```javascript
{
   setAllowedSideBars: <function>,
   getAllowedSideBars: <function>,
   setCurrentSideBar: <function>,
   getCurrentSideBar: <function>
}
```

### Examples

The following example demonstrates `SideBarToggleButton` in a practical document-editing workflow. The sidebar toggle button shown at the top right of the ribbon.

```javascript
function inspectSideBarToggleButton(sideBarToggleButton) {
    console.log("set allowed side bars:", sideBarToggleButton.setAllowedSideBars);
    console.log("get allowed side bars:", sideBarToggleButton.getAllowedSideBars);
    console.log("set current side bar:", sideBarToggleButton.setCurrentSideBar);
    console.log("get current side bar:", sideBarToggleButton.getCurrentSideBar);
}
```

---

## In This Section

- [Javascript: SideBarToggleButton.getAllowedSideBars Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getallowedsidebars-method/llms-full.txt): Returns the side bars which are currently shown in the side bar toggle / drop down button at the top right of the ribbon bar.
- [Javascript: SideBarToggleButton.getCurrentSideBar Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getcurrentsidebar-method/llms-full.txt): Returns the side bar which is shown in the side bar toggle / drop down button at the top right of the ribbon bar.
- [Javascript: SideBarToggleButton.setAllowedSideBars Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/setallowedsidebars-method/llms-full.txt): Sets the side bars which are shown in the side bar toggle / drop down button at the top right of the ribbon bar. The value TXTextControl.SideBarType.None or 0 removes the button altogether.
- [Javascript: SideBarToggleButton.setCurrentSideBar Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/setcurrentsidebar-method/llms-full.txt): Sets the side bar which is shown in the side bar toggle / drop down button at the top right of the ribbon bar.

---

## Nearby

- **Previous:** [Javascript: SelectionFormFieldInfo Constructor](https://docs.textcontrol.com/ds-server/reference/javascript/selectionformfieldinfo/constructor/llms-full.txt)
- **Next:** [Javascript: SideBarToggleButton.getAllowedSideBars Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getallowedsidebars-method/llms-full.txt)
