---
title: "tinymce.EditorMode"
description: "TinyMCE 5 Mode API."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editormode/"
md_url: "https://www.tiny.cloud/docs/tinymce/5/apis/tinymce.editormode/index.md"
version: "5"
last_updated: "2024-03-26T08:09:19Z"
tokens: 548
---
Important This page documents TinyMCE 5. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../../latest/apis/tinymce.editormode/).
# tinymce.EditorMode

TinyMCE 5 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.
