JSPM

suneditor

3.0.0-beta.34
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 42568
  • Score
    100M100P100Q144822F
  • License MIT

Vanilla JavaScript based WYSIWYG web editor

Package Exports

  • suneditor
  • suneditor/css
  • suneditor/css/contents
  • suneditor/interfaces
  • suneditor/langs/_Lang
  • suneditor/langs/ckb
  • suneditor/langs/cs
  • suneditor/langs/da
  • suneditor/langs/de
  • suneditor/langs/en
  • suneditor/langs/es
  • suneditor/langs/fa
  • suneditor/langs/fr
  • suneditor/langs/he
  • suneditor/langs/hu
  • suneditor/langs/index
  • suneditor/langs/it
  • suneditor/langs/ja
  • suneditor/langs/km
  • suneditor/langs/ko
  • suneditor/langs/lv
  • suneditor/langs/nl
  • suneditor/langs/pl
  • suneditor/langs/pt_br
  • suneditor/langs/ro
  • suneditor/langs/ru
  • suneditor/langs/se
  • suneditor/langs/tr
  • suneditor/langs/uk
  • suneditor/langs/ur
  • suneditor/langs/zh_cn
  • suneditor/package.json
  • suneditor/plugins
  • suneditor/src/assets/design/color.css
  • suneditor/src/assets/design/index.css
  • suneditor/src/assets/design/size.css
  • suneditor/src/assets/design/typography.css
  • suneditor/src/assets/icons/defaultIcons.js
  • suneditor/src/assets/suneditor-contents.css
  • suneditor/src/assets/suneditor.css
  • suneditor/src/core/base/actives.js
  • suneditor/src/core/base/history.js
  • suneditor/src/core/class/char.js
  • suneditor/src/core/class/component.js
  • suneditor/src/core/class/format.js
  • suneditor/src/core/class/html.js
  • suneditor/src/core/class/inline.js
  • suneditor/src/core/class/listFormat.js
  • suneditor/src/core/class/menu.js
  • suneditor/src/core/class/nodeTransform.js
  • suneditor/src/core/class/offset.js
  • suneditor/src/core/class/selection.js
  • suneditor/src/core/class/shortcuts.js
  • suneditor/src/core/class/toolbar.js
  • suneditor/src/core/class/ui.js
  • suneditor/src/core/class/viewer.js
  • suneditor/src/core/config/context.js
  • suneditor/src/core/config/frameContext.js
  • suneditor/src/core/config/options.js
  • suneditor/src/core/editor.js
  • suneditor/src/core/event/actions/index.js
  • suneditor/src/core/event/effects/common.registry.js
  • suneditor/src/core/event/effects/keydown.registry.js
  • suneditor/src/core/event/effects/ruleHelpers.js
  • suneditor/src/core/event/eventManager.js
  • suneditor/src/core/event/executor.js
  • suneditor/src/core/event/handlers/handler_toolbar.js
  • suneditor/src/core/event/handlers/handler_ww_clipboard.js
  • suneditor/src/core/event/handlers/handler_ww_dragDrop.js
  • suneditor/src/core/event/handlers/handler_ww_input.js
  • suneditor/src/core/event/handlers/handler_ww_key.js
  • suneditor/src/core/event/handlers/handler_ww_mouse.js
  • suneditor/src/core/event/ports.js
  • suneditor/src/core/event/reducers/keydown.reducer.js
  • suneditor/src/core/event/rules/keydown.rule.arrow.js
  • suneditor/src/core/event/rules/keydown.rule.backspace.js
  • suneditor/src/core/event/rules/keydown.rule.delete.js
  • suneditor/src/core/event/rules/keydown.rule.enter.js
  • suneditor/src/core/event/rules/keydown.rule.tab.js
  • suneditor/src/core/section/constructor.js
  • suneditor/src/core/section/documentType.js
  • suneditor/src/core/util/instanceCheck.js
  • suneditor/src/editorInjector/_classes.js
  • suneditor/src/editorInjector/_core.js
  • suneditor/src/editorInjector/index.js
  • suneditor/src/events.js
  • suneditor/src/helper/clipboard.js
  • suneditor/src/helper/converter.js
  • suneditor/src/helper/dom/domCheck.js
  • suneditor/src/helper/dom/domQuery.js
  • suneditor/src/helper/dom/domUtils.js
  • suneditor/src/helper/dom/index.js
  • suneditor/src/helper/env.js
  • suneditor/src/helper/index.js
  • suneditor/src/helper/keyCodeMap.js
  • suneditor/src/helper/numbers.js
  • suneditor/src/helper/unicode.js
  • suneditor/src/hooks/base.js
  • suneditor/src/hooks/params.js
  • suneditor/src/interfaces/contracts.js
  • suneditor/src/interfaces/index.js
  • suneditor/src/interfaces/plugins.js
  • suneditor/src/langs/ckb.js
  • suneditor/src/langs/cs.js
  • suneditor/src/langs/da.js
  • suneditor/src/langs/de.js
  • suneditor/src/langs/en.js
  • suneditor/src/langs/es.js
  • suneditor/src/langs/fa.js
  • suneditor/src/langs/fr.js
  • suneditor/src/langs/he.js
  • suneditor/src/langs/hu.js
  • suneditor/src/langs/index.js
  • suneditor/src/langs/it.js
  • suneditor/src/langs/ja.js
  • suneditor/src/langs/km.js
  • suneditor/src/langs/ko.js
  • suneditor/src/langs/lv.js
  • suneditor/src/langs/nl.js
  • suneditor/src/langs/pl.js
  • suneditor/src/langs/pt_br.js
  • suneditor/src/langs/ro.js
  • suneditor/src/langs/ru.js
  • suneditor/src/langs/se.js
  • suneditor/src/langs/tr.js
  • suneditor/src/langs/uk.js
  • suneditor/src/langs/ur.js
  • suneditor/src/langs/zh_cn.js
  • suneditor/src/modules/contract/Browser.js
  • suneditor/src/modules/contract/ColorPicker.js
  • suneditor/src/modules/contract/Controller.js
  • suneditor/src/modules/contract/Figure.js
  • suneditor/src/modules/contract/HueSlider.js
  • suneditor/src/modules/contract/Modal.js
  • suneditor/src/modules/contract/index.js
  • suneditor/src/modules/manager/ApiManager.js
  • suneditor/src/modules/manager/FileManager.js
  • suneditor/src/modules/manager/index.js
  • suneditor/src/modules/ui/ModalAnchorEditor.js
  • suneditor/src/modules/ui/SelectMenu.js
  • suneditor/src/modules/ui/_DragHandle.js
  • suneditor/src/modules/ui/index.js
  • suneditor/src/plugins/browser/audioGallery.js
  • suneditor/src/plugins/browser/fileBrowser.js
  • suneditor/src/plugins/browser/fileGallery.js
  • suneditor/src/plugins/browser/imageGallery.js
  • suneditor/src/plugins/browser/videoGallery.js
  • suneditor/src/plugins/command/blockquote.js
  • suneditor/src/plugins/command/exportPDF.js
  • suneditor/src/plugins/command/fileUpload.js
  • suneditor/src/plugins/command/list_bulleted.js
  • suneditor/src/plugins/command/list_numbered.js
  • suneditor/src/plugins/dropdown/align.js
  • suneditor/src/plugins/dropdown/backgroundColor.js
  • suneditor/src/plugins/dropdown/blockStyle.js
  • suneditor/src/plugins/dropdown/font.js
  • suneditor/src/plugins/dropdown/fontColor.js
  • suneditor/src/plugins/dropdown/hr.js
  • suneditor/src/plugins/dropdown/layout.js
  • suneditor/src/plugins/dropdown/lineHeight.js
  • suneditor/src/plugins/dropdown/list.js
  • suneditor/src/plugins/dropdown/paragraphStyle.js
  • suneditor/src/plugins/dropdown/table/index.js
  • suneditor/src/plugins/dropdown/table/render/table.html.js
  • suneditor/src/plugins/dropdown/table/render/table.menu.js
  • suneditor/src/plugins/dropdown/table/services/table.cell.js
  • suneditor/src/plugins/dropdown/table/services/table.clipboard.js
  • suneditor/src/plugins/dropdown/table/services/table.grid.js
  • suneditor/src/plugins/dropdown/table/services/table.resize.js
  • suneditor/src/plugins/dropdown/table/services/table.selection.js
  • suneditor/src/plugins/dropdown/table/services/table.style.js
  • suneditor/src/plugins/dropdown/table/shared/table.constants.js
  • suneditor/src/plugins/dropdown/table/shared/table.utils.js
  • suneditor/src/plugins/dropdown/template.js
  • suneditor/src/plugins/dropdown/textStyle.js
  • suneditor/src/plugins/field/mention.js
  • suneditor/src/plugins/index.js
  • suneditor/src/plugins/input/fontSize.js
  • suneditor/src/plugins/input/pageNavigator.js
  • suneditor/src/plugins/modal/audio.js
  • suneditor/src/plugins/modal/drawing.js
  • suneditor/src/plugins/modal/embed.js
  • suneditor/src/plugins/modal/image/index.js
  • suneditor/src/plugins/modal/image/render/image.html.js
  • suneditor/src/plugins/modal/image/services/image.size.js
  • suneditor/src/plugins/modal/image/services/image.upload.js
  • suneditor/src/plugins/modal/image/shared/image.constants.js
  • suneditor/src/plugins/modal/link.js
  • suneditor/src/plugins/modal/math.js
  • suneditor/src/plugins/modal/video/index.js
  • suneditor/src/plugins/modal/video/render/video.html.js
  • suneditor/src/plugins/modal/video/services/video.size.js
  • suneditor/src/plugins/modal/video/services/video.upload.js
  • suneditor/src/plugins/popup/anchor.js
  • suneditor/src/suneditor.js
  • suneditor/src/themes/dark.css
  • suneditor/src/typedef.js
  • suneditor/types

Readme

SunEditor

A lightweight and powerful WYSIWYG editor built with vanilla JavaScript

GitHub License npm npm weekly downloads jsDelivr CDN Test coverage

SunEditor supports all modern browsers without dependencies or polyfills.

🌟 Why SunEditor?

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.

Key Features

  • No dependencies — Optimized for speed and simplicity
  • 🧩 Modular architecture — Enable only the plugins you need
  • 📱 Responsive UI — Works smoothly on all modern devices
  • 🔌 Framework-friendly — Easy to use with React, Vue, Svelte, etc.
  • 💼 Feature-rich plugin ecosystem, including:
    • 🏷 @Mentions with autocomplete
    • 🎨 Advanced table editing & custom layouts
    • 🧮 Math (LaTeX), drawing, and code block support
    • 📂 Built-in media galleries (image, video, audio, file)
    • 📄 PDF export, templates, and embedded content (audio/video/iframe)

📝 Content Editing Approach

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 strictMode configuration in the Developer Guide.

🌤 Try all plugins in Playground

Contributions welcome! Please refer to Contribution Guidelines and check out our open tasks. ⭐


🌍 Browser Support

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
Chrome 119 (Oct 2023)
Edge 119 (Nov 2023)
Firefox 121 (Dec 2023)
Safari (macOS, iOS) 17.0 (Sep 2023)
Opera 105 (Nov 2023)
Android WebView 119 (Oct 2023)
Samsung Internet 23.0 (Oct 2023)
Firefox ESR 128 (Jul 2024)

❌ Not Supported : IE, Legacy Edge

📌 Why This Baseline? (Late 2023)

  • This is based on features commonly supported by modern browsers.
  • Most modern web APIs and CSS features are supported reliably in versions after this point.
  • Unless specific compatibility issues arise, you can use it out of the box without additional polyfills.
  • If you need support for older browsers, you can extend it by adding your own polyfills.

📦 Legacy Version (v2-legacy)

* 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.

👉 v2-legacy branch


🚀 Install & Quick Start

💡 Want to see it in action?
Check out the 🌤 Live Demo 🌤 with full options and examples.

NPM

npm install suneditor --save
import 'suneditor/css'; // Editor UI
import 'suneditor/css/contents'; // For displaying HTML
import suneditor from 'suneditor';

// HTML: <div id="editor"></div> or <textarea id="editor"></textarea>
suneditor.create(document.querySelector('#editor'), {
    // options
});

CDN (jsDelivr)

<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" />
<!-- Optional language (default is English): e.g., Korean (ko) -->
<!-- <script src="https://cdn.jsdelivr.net/npm/suneditor@latest/src/langs/ko.js"></script> -->

<div id="editor"></div>
<!-- or <textarea id="editor"></textarea> -->

<script>
    SUNEDITOR.create(document.querySelector('#editor'), {
        // options
    });
</script>

🔧 Framework Integration

You can use the official wrappers for easier integration:

React – suneditor-react
Vue – suneditor-vue


📦 Plugins

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.


✨ Contributors

contributors

💎 Sponsors

Financial Contributors on Open Collective


📄 License

SunEditor is an open-source project available under the MIT License.