# Toolbar Class

> Controls the main toolbar and its contextual toolbars.

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

---

### Description

Controls the main toolbar and its contextual toolbars.

### Syntax

```javascript
Toolbar
```

### Examples

The following example demonstrates `Toolbar` in a practical Document Viewer workflow. This object provides functionalities for controlling the toolbar.

```javascript
TXDocumentViewer.toolbar.show();
TXDocumentViewer.toolbar.enable();
console.table(TXDocumentViewer.toolbar.getItems());
```

---

## In This Section

- [Javascript: Toolbar.contextualToolbars Property](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/contextualtoolbars-property/llms-full.txt): Contextual annotation and tracked-changes toolbars.
- [Javascript: Toolbar.disable Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/disable-method/llms-full.txt): Disables toolbar interaction.
- [Javascript: Toolbar.enable Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/enable-method/llms-full.txt): Enables toolbar interaction.
- [Javascript: Toolbar.getItems Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/getitems-method/llms-full.txt): Returns the current main-toolbar items. The returned array can be changed without changing the toolbar configuration.
- [Javascript: Toolbar.hide Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/hide-method/llms-full.txt): Hides the toolbar.
- [Javascript: Toolbar.setItems Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/setitems-method/llms-full.txt): Replaces all main-toolbar items with DOM elements or built-in item descriptors.
- [Javascript: Toolbar.show Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/show-method/llms-full.txt): Shows the toolbar.

---

## Nearby

- **Previous:** [Javascript: StreamType Enumeration](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/streamtype/enumeration/llms-full.txt)
- **Next:** [Javascript: Toolbar.contextualToolbars Property](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/toolbar/contextualtoolbars-property/llms-full.txt)
