---
title: "tinymce.EditorMode"
description: "TinyMCE Editor Mode API."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editormode/"
md_url: "https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editormode/index.md"
version: "latest"
last_updated: "2022-06-27T01:45:26Z"
tokens: 501
---
# tinymce.EditorMode

TinyMCE Editor Mode API.

## Summary

### Properties

| Name | Type | Summary | Defined by |
| --- | --- | --- | --- |
| editorReadOnly | `Boolean` | Flags whether the editor should be made readonly while this mode is active. | `EditorMode` |

### Methods

| Name | Summary | Defined by |
| --- | --- | --- |
| [activate()](#activate) | Handler to activate this mode, called before deactivating the previous mode. | `EditorMode` |
| [deactivate()](#deactivate) | Handler to deactivate this mode, called after activating the new mode. | `EditorMode` |
| [get()](#get) | Returns the active editor mode, such as "design" or "readonly". | `EditorMode` |
| [isReadOnly()](#isReadOnly) | Checks if the editor is in a readonly state. | `EditorMode` |
| [register()](#register) | Registers a new editor mode. | `EditorMode` |
| [set()](#set) | Sets the editor mode. The available modes are "design" and "readonly". Additional modes can be registered using 'register'. | `EditorMode` |

## Methods

### activate()

```javascript
activate()
```
Handler to activate this mode, called before deactivating the previous mode.

### deactivate()

```javascript
deactivate()
```
Handler to deactivate this mode, called after activating the new mode.

### get()

```javascript
get(): String
```
Returns the active editor mode, such as "design" or "readonly".

#### Return value

- `String` - The active editor mode.

### isReadOnly()

```javascript
isReadOnly(): Boolean
```
Checks if the editor is in a readonly state.

#### Return value

- `Boolean` - true if the editor is in a readonly state.

### register()

```javascript
register(api: EditorModeApi)
```
Registers a new editor mode.

#### Parameters

- `api (EditorModeApi)` - Activation and Deactivation API for the new mode.

### set()

```javascript
set(mode: String)
```
Sets the editor mode. The available modes are "design" and "readonly". Additional modes can be registered using 'register'.

#### Parameters

- `mode (String)` - Mode to set the editor in.
