Component library
WYSIWYG Editor component
Last updated 2 November 2026
Defines a WYSIWYG editor. This component requires jQuery library.
Live demo
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous">
</script>Attributes
| FIELD ATTRIBUTE | TYPE | DEFAULT | OPTIONS | DESCRIPTION |
|---|---|---|---|---|
| has-code-editor | boolean | false | true, false | Enables the code editor view |
| label | string | "" | any | Label shown for the field |
| value | string | "" | any | Defines the field value |
| name | string | "" | any | Defines the field name |
| readonly | boolean | false | true, false | Make the field readonly |
| has-error | boolean | false | true, false | Defines if the field is invalid / error |
| error-message | string | "" | any | Message shown when field has error |
| theme | string | "" | default, monokai, neat, the-matrix, material | Theme color of code editor |
| disable-line-numbers | boolean | false | true, false | Hide code editor line numbers |
| mode | string | htmlmixed | css, htmlembedded, htmlmixed, javascript, markdown, python, vue, xml, yaml | Language mode of code editor (Syntax highlighting) |
| image-upload | boolean | false | true, false | Enables image upload feature of editor |
| images | string | "" | any | Enables image selection feature of editor |
| class-id | string | random (auto-generated) | any | Unique identifier of editor |
| show-source | boolean | false | true, false | Code editor view by default on component initialization |
| tooltip | string | "" | - | Displays a tooltip beside the label. Supports HTML Content |
| html-description | boolean | false | true, false | Enables HTML tags in the description |
| description | string | "" | any | Defines the description value |
Examples
Complete Example
<ins-editor
label="Editor Content"
has-code-editor
tooltip="This is a sample tooltip content. It also support html content.">
</ins-editor>Description Example
<ins-editor
label="Description Example"
html-description
description="This is a <strong>Description</strong> <i>Example</i>">
</ins-editor>Error State
<ins-editor
label="Error Field"
has-error
error-message="This is a required field">
</ins-editor>Read-Only State
<ins-markdown-editor
label="Readonly Field"
disable-line-numbers
value="You cannot edit this value" readonly>
</ins-markdown-editor>Direct Value Set
<ins-editor
id="directFieldEl">
</ins-editor>
<script>
var label = "Change logs - Sample";
var value = `<html>
<body>
<h1>Sample code</h1>
</body>
</html>`;
var field = document.getElementById('directFieldEl');
field.label = label;
field.value = value;
</script>Get WYSIWYG Editor Value
<ins-editor
label="Content"
id="myEditorEl"
has-code-editor>
</ins-editor>
<ins-button
solid
label="Get Value"
id="getValueBtn">
</ins-button>
<script>
var button = document.getElementById('getValueBtn');
var editorEl = document.getElementById('myEditorEl');
editorEl.addEventListener('didLoad', function(e){
button.addEventListener('click', function() {
console.log("Editor field value below:");
console.log(editorEl.val());
alert('check console to see the value');
});
});
</script>Enable Images
<ins-editor
label="Content"
image-upload
id="imagesEditorEl"
images="https://docs.prod01-insites.io/instances/630/property_uploads/modules/insites_assets/assets_upload/asset/12984ef2-3e9e-4d2b-8589-36cbcbedc03e/WYSIWYG Editor.svg?updated=1723193952">
</ins-editor>
<script>
var imagesEditorEl = document.getElementById('imagesEditorEl');
imagesEditorEl.addEventListener('onupload', testFileUpload);
function testFileUpload(event) {
var image = event.detail.image;
var upload = event.detail.upload;
upload.complete({
"file": {
"url": image.name,
"id": image.name
}
});
}
</script>