---
url: https://plugin.stripo.email/extensions/reference/constants/EditorState.md
---
# EditorState

:::::tip Version Availability
This interface is available starting from v3.8.0
:::::

Typed object returned by `BaseApi.getEditorState()`.

```typescript
interface EditorState {
  previewDeviceMode: PreviewDeviceMode;
  panelPosition: PanelPosition;
  themeMode: ThemeMode;
}
```

## Description

The `EditorState` interface groups the observable editor UI state into a single typed object. It lets extensions inspect the current preview mode, panel layout, and active editor theme.

## Import

```typescript
import { EditorState } from '@stripoinc/ui-editor-extensions';
```

## Properties

| Property | Type | Description                       |
|----------|------|-----------------------------------|
| `previewDeviceMode` | [`PreviewDeviceMode`](./PreviewDeviceMode) | Current device preview mode       |
| `panelPosition` | [`PanelPosition`](./PanelPosition) | Current panel arrangement         |
| `themeMode` | [`ThemeMode`](./ThemeMode) | Current email template theme mode |

## Example

```typescript
const state = this.api.getEditorState();

if (state.previewDeviceMode === PreviewDeviceMode.MOBILE) {
  this.useMobileLayout();
}

if (state.themeMode === ThemeMode.DARK) {
  this.useDarkThemeStyles();
}
```
