/syncfusion-javascript:syncfusion-javascript-headless-editorfrom Syncfusion JavaScript UI Controls
Implement rich-text editing with Syncfusion JavaScript Headless Editor. Covers editor initialization, document structure, commands, extensions, node types, marks, custom extensions, content operations, keyboard shortcuts, and advanced customization patterns.
Ships in Syncfusion JavaScript UI Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Syncfusion JavaScript Headless Editor is a powerful, extensible rich-text editing library built on ProseMirror. It provides programmatic control over document editing without bundling a UI, making it ideal for custom editor implementations, headless content systems, and embedded editing experiences.
Use the Headless Editor when you need:
This skill bundles 27 reference files that map to the Syncfusion TypeScript Headless Editor documentation: 26 conceptual reference files plus 1 API reference file (sourced from the Syncfusion API documentation at https://ej2.syncfusion.com/documentation/api/headless-editor/). The node types are split per-node — start with references/nodes.md for the index. Use the navigation below to locate the right reference for a given task.
📄 Read: references/getting-started.md
@syncfusion/ej2-headless-editor and the Tailwind 3 theme📄 Read: references/editor-methods.md
HeadlessEditor class (sourced from the Syncfusion API documentation at https://ej2.syncfusion.com/documentation/api/headless-editor/)HeadlessEditor.create(config)commands property (returns TypedCommandsFacade)mount, unmount, destroy, setOptions, setContent, setDocument, getDocument, getHtml, getText, getSelectionText, getSelection, getSelectionContext, getSelectedBlocks, getSelectedLeafNodes, getSelectedCells, saveSelection, restoreSelection, focusView, getFileHandler, setFileUploadHandler, can, chain, execute, on, off📄 Read: references/editor-api.md
HeadlessEditor.create()content, document, extensions, behavior toggles, lifecycle hooks)setOptions()destroy()getDocument, getHtml, getText, getSelectionText)setContent, setDocument)getSelection, getSelectionContext, getSelectedBlocks, getSelectedLeafNodes, getSelectedCells)saveSelection, restoreSelection)focusView)on, off)EditorConfig, selection helper types (SelectedNode, SelectionContext, SelectionMark, SelectionNode, SelectionSnapshotStatus), event payloads (ContentChangedEventArgs, DocumentChangedEventArgs, DocumentChangeAction), static factories (createSnapshot, withStatus) — all under ### API references📄 Read: references/document.md
DocumentRoot, EditorNode, TextNode, EditorState, Position, Mark — under ### API references📄 Read: references/core-commands.md
editor.commands.*, editor.execute)editor.can(), canRun())insertText, deleteText, replaceText, deleteRange)setSelection, clearSelection, selectAll)editor.chain())Command, CommandContext, PMCommandContext, NodeResolver, SelectionType), command facades (TypedCommandsFacade, TypedCanFacade, TypedChain), metadata types (CommandMeta, ChainResult, ValidationError), DeleteRangePayload — all under ### API references📄 Read: references/content-operations.md
getDocument, getHtml, getText, getSelectionText)setContent, setDocument)📄 Read: references/clipboard.md
beforePaste, afterPaste events)EditorConfig.clipboard hooks: transformHTML, transformContent)ClipboardContent, ClipboardOptions, ClipboardTransformContext, PasteContent, BeforePasteEventArgs, AfterPasteEventArgs — under ### API references📄 Read: references/file-upload.md
FileHandler → upload → node insertion)getFileHandler, setFileUploadHandlerEditorConfig options: fileUploadHandler, beforeFileUpload, fileReceivedbeforeFileUpload (MIME/size validation), fileReceivedFileHandler, PendingFileUpload, FileUploadHandler, FileUploadProgress, FileUploadRequest, FileUploadResult, BeforeFileUploadEventArgs, FileReceivedEventArgs — under ### API references📄 Read: references/extensions.md
basicExtensions preset📄 Read: references/customization.md
AttributeDefinition, NodeGroup, NodeDefinition, MarkDefinition), NodeContent, extension authoring types (ExtensionConfig, ExtensionDefinition, ExtensionOptions, ExtensionDOMSpecs, NodeDOMDescriptor, MarkDOMDescriptor, DOMOutputDescriptor, NodeViewDescriptor, NodeViewConstructor), input-rule option types (CreateNodeRuleOptions, CreateLinkRuleOptions, CreateTextBlockRuleOptions, CreateWrappingRuleOptions, InputRuleDefinition, InputRuleContext), static factory functions (defineExtension, createLinkRule, createMarkRule, createTextBlockRule, createWrappingRule) — all under ### API references📄 Read: references/mark-types.md
toLowerCase, toUpperCase case transformsSetHighlightPayload, SetColorPayload, SetFontFamilyPayload, SetFontSizePayload, SetLinkPayload) and LinkExtensionOptions under each mark's ### API referencesSetMarkPayload under ## Generic Mark Payload📄 Read: references/advanced-features.md
setTextAlign / unsetTextAlign commands)indentOutdentExtension, Tab/Shift-Tab)undoRedoExtension)PlaceholderOptions, TextAlignOptions, UndoRedoOptions, static factories setTextAlignCommand/unsetTextAlignCommand — all under ### API references📄 Read: references/accessibility-security.md
📄 Read: references/nodes.md
listKeymapExtension, collapsibleKeymapExtension)📄 Read: references/paragraph.md
documentalign, indent, htmlAttributes📄 Read: references/heading.md
level, align, indent, htmlAttributesSetHeadingPayload under ### API references📄 Read: references/block-quote.md
blockquote container; renders as <blockquote>basicExtensions preset> followed by space📄 Read: references/code-block.md
<pre><code>basicExtensions presetCodeBlockOptions, IndentCodeBlockPayload, OutdentCodeBlockPayload under ### API references📄 Read: references/list.md
bulletList + listItem) and ordered list (orderedList + listItem)listStyleType, order, htmlAttributes, itemHtmlAttributes- / * / + for bullets, 1. for orderedListExtensionOptions, ListKeymapExtensionOptions, list-type payloads (SetBulletListTypePayload, SetOrderedListTypePayload, ToggleBulletListPayload, ToggleOrderedListPayload, ToggleListTypePayload) under ### API references📄 Read: references/task-list.md
taskList + taskItem)checked, nested, htmlAttributes, itemHtmlAttributes[] or [ ] followed by spaceTaskListExtensionOptions, ToggleTaskCheckedPayload, ToggleTaskListPayload under ### API references📄 Read: references/horizontal-rule.md
horizontalRule node; renders as <hr>basicExtensions preset---, ***, or ___ on an empty line📄 Read: references/callout.md
!!! for info, ::: for noteCalloutExtensionOptions, CalloutVariant under ### API references📄 Read: references/collapsible.md
collapse / expand commandsCollapsibleExtensionOptions, CollapsePayload, ExpandPayload under ### API references📄 Read: references/table.md
table, tableRow, tableCell, tableHeader)TableOptions, InsertTablePayload, cell selection types (CellSelection, SelectedCell) under ### API references📄 Read: references/image.md
src, alt, width, height, title attributesImageOptions, image resize options, image-upload payloads, image enums, InsertImagePayload under ### API references📄 Read: references/text-node.md
text node; auto-registered📄 Read: references/hard-break.md
hardBreak node; renders as <br>basicExtensions presetimport './style.css';
import { HeadlessEditor, basicExtensions, placeholderExtension } from '@syncfusion/ej2-headless-editor';
const editor = HeadlessEditor.create({
extensions: [basicExtensions, placeholderExtension]
});
const container = document.getElementById('headless-editor');
if (container) {
editor.mount(container);
}
src/index.html)<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Syncfusion TypeScript Headless Editor</title>
</head>
<body>
<div id="container">
<div id="headless-editor"></div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
src/style.css)@import "../node_modules/@syncfusion/ej2-tailwind3-theme/styles/headless-editor/index.css";
Get the structured document as JSON:
const doc = editor.getDocument();
console.log(doc.type); // 'document'
doc.children.forEach((node) => console.log(node.type));
Serialize to HTML:
const html = editor.getHtml();
console.log(html); // "<p>Hello <strong>world</strong></p>"
Get plain text:
const text = editor.getText();
console.log(text); // "Hello world"
Get selected text only:
const selected = editor.getSelectionText();
if (selected) {
console.log(`User selected: ${selected}`);
}
Replace with HTML:
editor.setContent('<h1>New Title</h1><p>Fresh content.</p>');
Clear to empty paragraph:
editor.setContent('');
Assign structured document:
editor.setDocument({
type: 'document',
attrs: {},
children: [
{ type: 'paragraph', attrs: {}, children: [] }
]
});
Insert text at current selection:
editor.commands.insertText({ text: 'Hello world' });
Insert at specific offset:
editor.commands.insertText({ text: 'Hello world', at: { offset: 0 } });
Replace text in range:
editor.commands.replaceText({
from: { offset: 0 },
to: { offset: 11 },
text: 'Updated text'
});
Enable read-only mode:
const editor = HeadlessEditor.create({
extensions: [basicExtensions],
readOnly: true
});
Update options after creation:
editor.setOptions({
readOnly: true,
autoSaveSelectionOnBlur: true
});
Enable markdown input rules (default):
const editor = HeadlessEditor.create({
extensions: [basicExtensions],
enableInputRules: true
});
Recommended pattern for teardown:
const editor = HeadlessEditor.create({
extensions: [basicExtensions],
destroyed: () => {
console.log('Editor cleaned up');
}
});
editor.mount(container);
// Clean up on page unload
window.addEventListener('beforeunload', () => {
editor.destroy();
});
Note: destroy() is safe to call more than once and should be called in teardown hooks.
HeadlessEditor.create()mount()unmount()destroy()document node containing block-level childrentrue when a change happened and false otherwiseeditor.commands.toggleBold(), editor.commands.setHeading({ level: 2 })| Option | Type | Default | Purpose |
|---|---|---|---|
extensions | Extension[] | - | Enable features such as bold, headings, lists, and tables |
content | string | - | Initial HTML content |
document | DocumentRoot | - | Initial document (alternative to content); takes precedence when both are provided |
autofocus | - | - | Focus the editor automatically when it is mounted |
readOnly | - | - | Render the editor in read-only mode |
enableInputRules | - | true | Enable markdown-style autoformatting |
enableTabKey | - | true | Enable Tab and Shift+Tab behavior |
autoSaveSelectionOnBlur | - | - | Save the selection when the editor loses focus |
Structural properties such as document, content, extensions, and clipboard cannot be changed after creation. To change them, destroy the editor and create a new one.
Lifecycle Callbacks:
| Callback | Purpose |
|---|---|
created | Called when editor is fully initialized |
destroyed | Called when editor is destroyed |
contentChanged | Called when document content changes |
documentChanged | Called when the document is replaced (via setContent / setDocument) with action: 'Replaced' |
selectionChanged | Called when selection/cursor moves |
focus | Called when editor receives focus |
blur | Called when editor loses focus |
references/accessibility-security.md (opens in a new tab)references/advanced-features.md (opens in a new tab)references/block-quote.md (opens in a new tab)references/callout.md (opens in a new tab)references/clipboard.md (opens in a new tab)references/code-block.md (opens in a new tab)references/collapsible.md (opens in a new tab)references/content-operations.md (opens in a new tab)references/core-commands.md (opens in a new tab)references/customization.md (opens in a new tab)references/document.md (opens in a new tab)references/editor-api.md (opens in a new tab)references/editor-methods.md (opens in a new tab)references/extensions.md (opens in a new tab)references/file-upload.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/hard-break.md (opens in a new tab)references/heading.md (opens in a new tab)references/horizontal-rule.md (opens in a new tab)references/image.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-javascriptOther plugins' skills for the same job
67 skills in this plugin
/syncfusion-javascript-3d-chartCreate interactive 3D charts in Syncfusion TypeScript and JavaScript. Immediately use this skill when user needs to build 3D visualizations, render 3D column/bar charts, configure 3D rotation and depth, visualize data in three dimensions, customize 3D chart appearance, handle 3D interactions, or implement advanced 3D features. Works with TypeScript (webpack/module-based) and JavaScript (CDN/ES5)./syncfusion-javascript-accordionBuild collapsible navigation panels with the Syncfusion TypeScript Accordion component. Use this skill when implementing vertical accordion menus, expanding/collapsing content panels, multi-step wizards, data-driven panels with dynamic content, tabbed navigation alternatives, or nested hierarchical content structures. Covers initialization, expand modes, animations, icons, templates, styling, data binding, and advanced use cases like form wizards./syncfusion-javascript-accumulation-chartImplements Syncfusion JavaScript accumulation charts (Pie, Doughnut, Funnel, Pyramid) for proportional and percentage-based visualizations. Use when displaying categorical or proportional data. Covers legend and label configuration, interactivity, accessibility, and customization. Works with TypeScript (modules) and JavaScript (CDN/ES5).