# Javascript: DocumentViewerController.toolbar Property

> Controls the main toolbar and its contextual toolbars. Available after initialize() completes.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Property
- **Path:** DS Server > Reference > JavaScript API - Document Viewer > Javascript: DocumentViewerController.toolbar Property
- **161 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/toolbar-property/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/toolbar-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/toolbar-property/llms-full.txt

---

### Description

Controls the main toolbar and its contextual toolbars. Available after [initialize()](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/llms-full.txt) completes.

### Syntax

```javascript
<Toolbar> DocumentViewerController.toolbar
```

### Examples

The following example demonstrates `TXDocumentViewer.toolbar` in a practical Document Viewer workflow. Provides functionalities for controlling the toolbar.

```javascript
const toolbar = TXDocumentViewer.toolbar;
toolbar.show();
console.log("Toolbar items:", toolbar.getItems().length);
```

---

## Nearby

- **Previous:** [Javascript: DocumentViewerController.toggleToolbar Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/toggletoolbar-method/llms-full.txt)
- **Next:** [Javascript: DocumentViewerController.trackedChanges Property](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/documentviewercontroller/trackedchanges-property/llms-full.txt)
