A lightweight and powerful WYSIWYG editor built with vanilla JavaScript
<a href="https://github.com/JiHong88/SunEditor/blob/master/LICENSE.txt" title="MIT License"><img src="https://img.shields.io/github/license/jihong88/suneditor.svg?style=flat-square" alt="GitHub License"></a>
<a href="https://www.npmjs.com/package/suneditor" title="npm release"><img src="https://img.shields.io/npm/v/suneditor.svg?style=flat-square" alt="npm"></a>
<a href="https://www.npmjs.com/package/suneditor" title="npm month downloads"><img src="https://img.shields.io/npm/dm/suneditor.svg?logo=npm&style=flat-square" alt="npm weekly downloads"></a>
<a href="https://www.jsdelivr.com/package/npm/suneditor" title="jsDelivr CDN month downloads"><img src="https://img.shields.io/jsdelivr/npm/hm/suneditor?label=CDN&style=flat-square" alt="jsDelivr CDN" /></a>
<a href="https://codecov.io/gh/jihong88/suneditor" title="Test coverage"><img src="https://codecov.io/gh/jihong88/suneditor/branch/develop/graph/badge.svg" alt="Test coverage" /></a>
SunEditor supports all modern browsers without dependencies or polyfills.
SunEditor is a lightweight, fast, and extensible WYSIWYG editor written in pure JavaScript.
It's easy to integrate, highly customizable, and built for modern web applications.
SunEditor is optimized for structured content (articles, documentation, emails) rather than arbitrary HTML editing. Content is validated and auto-corrected to maintain consistency.
For raw HTML editing needs, see
strictModeconfiguration in the Architecture Guide.
🌤 Try all plugins in Playground
⭐ Contributions welcome! Please refer to Contribution Guidelines and check out our open tasks. ⭐
SunEditor is built to take advantage of modern browser capabilities.
It does not ship with polyfills by default, but you can add them if your project requires broader compatibility.
Works correctly on the following versions or newer.
| Browser | ≥ Version |
|---|---|
| 119 (Oct 2023) | |
| 119 (Nov 2023) | |
| 125 (Apr 2024) | |
| 17.2 (Dec 2023) | |
| 105 (Nov 2023) | |
| 119 (Oct 2023) | |
| 23.0 (Oct 2023) | |
| 128 (Jul 2024) |
❌ Not Supported : IE, Legacy Edge
* Supported IE11
SunEditor v3 is the latest version.
This section refers to the previous stable version, SunEditor v2.
The v2-legacy branch is no longer actively maintained,
but still available for compatibility with older projects.
💡 Want to see it in action?
Check out the 🌤 Live Demo 🌤 with full options and examples.
npm install suneditor --save
import 'suneditor/css/editor'; // Editor UI
import 'suneditor/css/contents'; // For displaying HTML
import suneditor from 'suneditor';
// HTML:
or <textarea id="editor"></textarea>
suneditor.create(document.querySelector('#editor'), {
// options
});
<script src="https://cdn.jsdelivr.net/npm/suneditor@latest/dist/suneditor.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/suneditor@latest/dist/suneditor.min.css" rel="stylesheet" />
<script>
SUNEDITOR.create(document.querySelector('#editor'), {
// options
});
</script>
You can use the official wrappers for easier integration:
React – suneditor-react\ Vue – suneditor-vue
SunEditor supports a plugin-based architecture.\ You can enable only the plugins you need or even create your own custom ones.
suneditor.create('#editor', {
plugins: ['font', 'image', 'video'],
image: {
uploadUrl: 'https://upload.image',
},
});
📘 Learn how to build your own plugin →
🤖 Want to build plugins? Get real-time help from SunEditor Devs AI.\ See Contribution Guide for tips and examples.
SunEditor is an open-source project available under the MIT License.
$ claude mcp add suneditor \
-- python -m otcore.mcp_server <graph>