# ToolbarBehavior

interface

A class interface defining the behavior of the [`ToolbarView`](module_ui_toolbar_toolbarview-ToolbarView.md).

Toolbar behaviors extend its look and functionality and have an impact on the [`element`](module_ui_toolbar_toolbarview-ToolbarView.md#member-element) template or [rendering](module_ui_toolbar_toolbarview-ToolbarView.md#function-render). They can be enabled conditionally, e.g. depending on the configuration of the toolbar.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/toolbar/toolbarview.ts#L1177)

<a id="properties">

## Properties

<a id="member-type">

### `type: 'static' | 'dynamic'`

Indicates the type of the toolbar behavior. Dynamic toolbar can hide items that do not fit into the available space. Static toolbar does not hide items and does not respond to the changes of the viewport.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/toolbar/toolbarview.ts#L1199)

<a id="methods">

## Methods

<a id="function-destroy">

### `destroy() → void`

A method called after the toolbar has been [destroyed](module_ui_toolbar_toolbarview-ToolbarView.md#function-destroy). It allows cleaning up after the toolbar behavior, for instance, this is the right place to detach event listeners, free up references, etc.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/toolbar/toolbarview.ts#L1193)

#### Returns

* `void`

<a id="function-render">

### `render( view ) → void`

A method called after the toolbar has been [rendered](module_ui_toolbar_toolbarview-ToolbarView.md#function-render). It can be used to, for example, customize the behavior of the toolbar when its [`element`](module_ui_toolbar_toolbarview-ToolbarView.md#member-element) is available.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/toolbar/toolbarview.ts#L1186)

#### Parameters

* `view: ToolbarView`

  An instance of the toolbar being rendered.

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
