Custom Editors

How to write your own editor

Custom editors are enabling developers to replace the default editors with HTML5 applications so the editing experience of the Squidex Web App can be customized.

Technically speaking a UI editor lives in a sandboxed iframe,which interacts with the web application through a small SDK using messaging. This SDK is a proxy of the Angular ControlValueAccessor, without having the dependencies to Angular itself.

Define Editor URL

Lets see how the code looks like:

<!DOCTYPE html>
<meta charset="utf-8">
<!-- Load the editor sdk from the local folder or -->
<script src="editor-sdk.js"></script>
<script src=""></script>
.ck-editor__editable {
min-height: 250px;
<textarea name="content" id="editor"></textarea>
var element = document.getElementById('editor');
.catch(error => {
.then(editor => {
// When the field is instantiated it notified the UI that it has been loaded.
var field = new SquidexFormField();
// Handle the value change event and set the text to the editor.
field.onValueChanged(function (value) {
if (value) {
// Disable the editor when it should be disabled.
field.onDisabled(function (disabled) {
editor.set('isReadOnly', disabled);
editor.model.document.on('change', function () {
var data = editor.getData();
// Notify the UI that the value has been changed. Will be used to trigger validation.
editor.ui.focusTracker.on('change:isFocused', function (event, name, isFocused) {
if (!isFocused) {
// Notify the UI that the value has been touched.

You just have to reference the editor SDK and handle the events. You also have to push the current value to the web application whenever it changes. Validation will happen automatically then.

All Examples

Also, we have more example you can use them on your apps.

1. Simple CKE Editor


CKE Editor

Clone the sample and configure the CKE editor as you need it.

2. Country selector


Country Selector

3. Product taxonomy


The data format is a list of url like paths for each product category that will be converted to a tree strucuture.

Product taxonomy

4. JSON Tree


Create a visual tree for a JSON object.