2026年前端富文本编辑器选型全指南:16款主流方案横向对比
富文本编辑器,前端圈永远的”选型难题”。
功能太弱的满足不了需求,功能太强的包体积爆炸,开源的怕没人维护,商业的又贵得肉疼。2026 年了,这个领域格局又变了——有的编辑器崛起,有的倒下,有的换了主人。
我把目前主流的 16 款前端富文本编辑器做了一次全面梳理,从技术内核、维护状态到适用场景,附上 GitHub 源码链接和代码示例,帮你一次看懂。
一、先看全景:16 款编辑器总览
|
|
|
|
|
|
|
|---|---|---|---|---|---|
| Tiptap |
|
|
|
|
|
| Lexical |
|
|
|
|
|
| Quill |
|
|
|
|
|
| CKEditor 5 |
|
|
|
|
|
| TinyMCE |
|
|
|
|
|
| Slate.js |
|
|
|
|
|
| Editor.js |
|
|
|
|
|
| Froala |
|
|
|
|
|
| ProseMirror |
|
|
|
|
|
| Jodit |
|
|
|
|
|
| TextBus |
|
|
|
|
|
| UEditorPlus |
|
|
|
|
|
| wangEditor |
|
|
|
|
|
| wangEditor-next |
|
|
|
|
|
| Draft.js |
|
|
|
|
|
| Summernote |
|
|
|
|
|
数据统计于 2026 年 5-7 月,GitHub Stars 和 npm 下载量仅供参考。
二、第一梯队:新项目首选
Tiptap —— 2026 年最热门的选择
🔗 GitHub: ueberdosis/tiptap[1] 📦 npm:
@tiptap/core@tiptap/react@tiptap/starter-kit🌐 官网: tiptap.dev[2]
Tiptap 基于 ProseMirror,采用无头(headless)架构——它只管数据和逻辑,UI 完全由你来定。这意味着你可以用任何设计系统、任何 CSS 框架来构建编辑器界面。
核心开源免费,Cloud 服务提供协作编辑(Hocuspocus)、AI 工具包、DOCX/Markdown 转换等付费功能。100+ 扩展生态,支持 Vue / React / 原生 JS。
安装:
npm install @tiptap/react @tiptap/pm @tiptap/starter-kit
React 示例:
import { useEditor, EditorContent } from'@tiptap/react'importStarterKitfrom'@tiptap/starter-kit'functionTiptapEditor() {const editor = useEditor({extensions: [StarterKit],content: '<p>Hello World!</p>', })return<EditorContenteditor={editor} />}
Vue 3 示例:
<script setup>import { useEditor, EditorContent } from '@tiptap/vue-3'import StarterKit from '@tiptap/starter-kit'const editor = useEditor({ extensions: [StarterKit], content: '<p>Hello Tiptap!</p>',})</script><template> <EditorContent :editor="editor" /></template>
优势:
-
无头架构,UI 完全可控 -
100+ 扩展,生态丰富 -
协作编辑方案成熟 -
TypeScript 支持良好 -
文档质量高
劣势:
-
核心免费,高级功能需付费 -
需要自己搭建 UI 组件(工具栏、气泡菜单等) -
生产就绪通常需要 2-4 周开发 -
包体积偏大
适合谁: 现代 SaaS 产品、Notion 风格应用、需要深度定制 UI 和协作功能的团队。
Lexical —— Meta 出品的性能王者
🔗 GitHub: facebook/lexical[3] 📦 npm:
lexical@lexical/react🌐 官网: lexical.dev[4]
Lexical 是 Meta(Facebook)开发的编辑器框架,是 Draft.js 的官方继任者。它驱动着 Facebook、Messenger、WhatsApp 的编辑器。核心仅 22kb,性能极致。
插件化架构,每个功能都是可选插件。React 优先支持,同时覆盖 iOS 和 Android。可访问性(Accessibility)是设计核心。
安装:
npm install --save lexical @lexical/react
React 示例:
import { LexicalComposer } from'@lexical/react/LexicalComposer'import { RichTextPlugin } from'@lexical/react/LexicalRichTextPlugin'import { ContentEditable } from'@lexical/react/LexicalContentEditable'import { HistoryPlugin } from'@lexical/react/LexicalHistoryPlugin'import { OnChangePlugin } from'@lexical/react/LexicalOnChangePlugin'const theme = { /* 自定义样式 */ }functiononError(error) {console.error(error)}functionEditor() {const initialConfig = {namespace: 'MyEditor', theme, onError, }return (<LexicalComposerinitialConfig={initialConfig}><RichTextPlugincontentEditable={<ContentEditable />} placeholder={<div>开始输入...</div>} /><HistoryPlugin /><OnChangePluginonChange={(state) => console.log(state)} /></LexicalComposer> )}
优势:
-
性能最强,22kb 轻量核心 -
Meta 持续维护,有保障 -
可访问性合规 -
跨平台支持(Web/iOS/Android) -
大文档处理高效
劣势:
-
文档仍在完善中,不如 Tiptap 成熟 -
高级功能需要自行实现 -
非 React 项目集成成本较高 -
社区规模小于 Tiptap
适合谁: React 应用、对性能有极致要求、需要跨平台的项目。
Quill —— 老牌轻量的稳妥之选
🔗 GitHub: slab/quill[5] 📦 npm:
quill🌐 官网: quilljs.com[6]
Quill 是老牌轻量级编辑器,Stars 数最高(47.1k)。Quill 2.0 重构了底层架构,采用 Delta JSON 数据模型。框架无关,开箱即用,API 简洁。
安装:
npm install quill
原生 JS 示例:
importQuillfrom'quill'import'quill/dist/quill.snow.css'const quill = newQuill('#editor', {theme: 'snow',placeholder: '开始编写...',modules: {toolbar: [ ['bold', 'italic', 'underline', 'strike'], ['blockquote', 'code-block'], [{ header: 1 }, { header: 2 }], [{ list: 'ordered' }, { list: 'bullet' }], ['link', 'image'], ['clean'], ], },})// 获取内容const html = quill.root.innerHTMLconst text = quill.getText()
优势:
-
轻量、易上手 -
社区庞大,踩坑资料丰富 -
Delta JSON 数据模型清晰 -
完全免费开源
劣势:
-
核心架构较老 -
定制能力有限 -
大文档性能一般 -
表格、协作等复杂功能需额外扩展
适合谁: 轻量应用、博客系统、评论框、对定制化要求不高的场景。
三、第二梯队:特定场景的王者
CKEditor 5 —— 企业级标杆
🔗 GitHub: ckeditor/ckeditor5[7] 📦 npm:
@ckeditor/ckeditor5-build-classic或ckeditor5🌐 官网: ckeditor.com/ckeditor-5[8]
功能最全面的方案,支持经典、气球、文档等多种 UI 模式。内置实时协作、版本控制、WCAG 可访问性合规。GPL 开源,商业使用需购买授权。
安装:
npm install --save @ckeditor/ckeditor5-build-classic
原生 JS 示例:
importClassicEditorfrom'@ckeditor/ckeditor5-build-classic'ClassicEditor .create(document.querySelector('#editor'), {toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote'],heading: {options: [ { model: 'paragraph', title: '段落' }, { model: 'heading1', view: 'h1', title: '标题1' }, { model: 'heading2', view: 'h2', title: '标题2' }, ] } }) .then(editor => {window.editor = editor }) .catch(err =>console.error(err))
注意: GPL 许可证对商业项目有传染性要求,务必评估法律风险。
适合谁: 企业 CMS、合规文档系统、需要开箱即用协作功能的项目。
TinyMCE —— 插件生态之王
🔗 GitHub: tinymce/tinymce[9] 📦 npm:
tinymce@tinymce/tinymce-react@tinymce/tinymce-vue🌐 官网: tiny.cloud[10]
超过十年的老牌编辑器,插件生态最庞大。社区版免费,高级功能(AI 助手、协作)需付费。与主流框架集成良好,中文支持好。
安装:
npm install tinymce @tinymce/tinymce-react
React 示例:
import { Editor } from'@tinymce/tinymce-react'functionTinyEditor() {return (<EditorapiKey="your-api-key"init={{height:400,menubar:false,language: 'zh_CN',plugins: 'listslinkimagetablecodewordcount',toolbar: 'undoredo | bolditalic | alignleftaligncenteralignright | bullistnumlist | linkimagetable | code', }}onChange={(e) => console.log(e.target.getContent())} /> )}
适合谁: 传统 CMS、邮件编辑器、后台管理系统、需要丰富插件的中大型项目。
Slate.js —— 极致自定义
🔗 GitHub: ianstormtaylor/slate[11] 📦 npm:
slateslate-reactslate-history🌐 官网: docs.slatejs.org[12]
React 专用的可定制编辑器框架,插件化架构,提供完全的渲染控制权。API 在 0.50+ 后趋于稳定。
安装:
npm install slate slate-react slate-history
React 示例:
import { createEditor } from'slate'import { Slate, Editable, withReact } from'slate-react'import { withHistory } from'slate-history'functionSlateEditor() {const editor = withHistory(withReact(createEditor()))const initialValue = [ { type: 'paragraph', children: [{ text: '欢迎使用 Slate 编辑器!' }] }, ]return (<Slateeditor={editor}initialValue={initialValue}><Editable /></Slate> )}
适合谁: 需要从零构建特殊文档结构、有足够开发资源的团队。
Editor.js —— 结构化内容利器
🔗 GitHub: codex-team/editor.js[13] 📦 npm:
@editorjs/editorjs@editorjs/header@editorjs/list🌐 官网: editorjs.io[14]
块编辑器(Block-based),类似 Notion 的编辑体验。输出干净的 JSON 而非 HTML,非常适合 API 驱动的内容管理和跨平台渲染。
安装:
npm install @editorjs/editorjs @editorjs/header @editorjs/list @editorjs/image
JS 示例:
importEditorJSfrom'@editorjs/editorjs'importHeaderfrom'@editorjs/header'importListfrom'@editorjs/list'const editor = newEditorJS({holder: 'editorjs',tools: {header: { class: Header, inlineToolbar: true },list: { class: List, inlineToolbar: true }, },})// 保存数据const savedData = await editor.save()console.log(savedData) // 输出 JSON
适合谁: CMS、知识库、需要结构化数据输出的内容平台。
ProseMirror —— 底层之王
🔗 GitHub: prosemirror/prosemirror[15] 📦 npm:
prosemirror-stateprosemirror-viewprosemirror-model🌐 官网: prosemirror.net[16]
不是开箱即用的编辑器,而是构建编辑器的底层工具包。Tiptap 就是基于它构建的。Schema 驱动的数据模型,原生支持协作编辑。被纽约时报、Asana 等采用。
安装:
npm install prosemirror-state prosemirror-view prosemirror-model prosemirror-schema-basic prosemirror-history
JS 示例:
import { schema } from'prosemirror-schema-basic'import { EditorState } from'prosemirror-state'import { EditorView } from'prosemirror-view'import { undo, redo, history } from'prosemirror-history'import { keymap } from'prosemirror-keymap'const state = EditorState.create({ schema,plugins: [history(),keymap({ 'Mod-z': undo, 'Mod-y': redo }), ],})const view = newEditorView(document.querySelector('#editor'), { state,})
适合谁: 需要构建高度定制化协作编辑器、有强大工程团队的项目。
Froala —— 商业精品
🔗 GitHub: froala/wysiwyg-editor[17] 📦 npm:
froala-editor🌐 官网: froala.com[18]
以现代 UI 设计和良好用户体验著称。无 jQuery 依赖,集成简单。
安装:
npm install froala-editor
JS 示例:
import'froala-editor/js/froala_editor.pkgd.min.js'import'froala-editor/css/froala_editor.pkgd.min.css'newFroalaEditor('#editor', {toolbarButtons: ['bold', 'italic', 'underline', '|', 'insertLink', 'insertImage', '|', 'undo', 'redo'],height: 300,})
适合谁: 对 UI 品质要求高、有预算购买授权、需要快速上线的项目。
TextBus —— 国产高性能框架
🔗 GitHub: textbus/textbus[19] 📦 npm:
@textbus/core@textbus/react@textbus/vue🌐 官网: textbus.io[20]
TextBus 是一个组件化、数据驱动的富文本框架,5.0 版本引入了主从架构设计。最大的亮点是原生支持 Viewfly、React、Vue 三大框架渲染——不是简单适配,而是直接用框架组件渲染富文本内容。
性能方面非常能打:官方称可流畅处理超大规模文档,支持数万 DOM 节点和数万个块级元素。基于 Yjs 的协作编辑能力内置。全 TypeScript 支持,抽象了光标和选区系统,开发者不用直接和浏览器 Selection API 搏斗。
安装:
npm install @textbus/core @textbus/react
React 示例:
import { useRT } from'@textbus/react'import { Textbus } from'@textbus/core'functionTextbusEditor() {const rt = useRT()return (<divref={rt}style={{minHeight:200 }}> {/* TextBus 自动接管渲染 */}</div> )}
优势:
-
原生支持 Viewfly / React / Vue 渲染 -
大文档性能出色 -
组件化架构,扩展性强 -
Yjs 协作内置 -
活跃维护,v5.5.2 (2026-06)
劣势:
-
社区规模小(1.4k stars) -
生态和插件不如 Tiptap 丰富 -
文档以中文为主 -
知名度低,踩坑资料少
适合谁: 需要多框架渲染能力、处理超大规模文档、追求高性能的国产替代方案。
四、国产编辑器:wangEditor 与 UEditorPlus
wangEditor(原版)—— 已暂停维护
🔗 GitHub: wangeditor-team/wangEditor[21] 📦 npm:
@wangeditor/editor@wangeditor/editor-for-vue🌐 官网: [22]www.wangeditor.com[23]
国产开源富文本编辑器,曾经是国内开发者的热门选择。10 行代码即可创建编辑器,中文文档完善。2024 年作者王福朋宣布暂停维护。
“目前暂无精力维护 wangEditor,最近行业形势也不太好,先努力搞钱吧。” —— 王福朋
现状: 仍可使用,但不再更新。新项目不建议使用。
wangEditor-next —— 社区接手
🔗 GitHub: wangeditor-next/wangeditor-next[24] 📦 npm:
@wangeditor-next/editor@wangeditor-next/editor-for-vue🌐 官网: wangeditor-next.com[25]
原项目的 fork 版本,在尽量不 Breaking Change 的前提下继续维护。支持 Vue2/3、React,新增了 Yjs 协作支持。2026 年 6 月仍在更新。
安装:
npm install @wangeditor-next/editor @wangeditor-next/editor-for-vue@next
Vue 3 示例:
<script setup>import { Editor, Toolbar } from '@wangeditor-next/editor-for-vue'import { onBeforeUnmount, ref, shallowRef } from 'vue'import '@wangeditor-next/editor/dist/css/style.css'const editorRef = shallowRef()const mode = 'default'const toolbarConfig = {}const editorConfig = { placeholder: '请输入内容...' }onBeforeUnmount(() => { editorRef.value?.destroy()})</script><template> <Toolbar :editor="editorRef" :mode="mode" :defaultConfig="toolbarConfig" /> <Editor v-model="valueHtml" :mode="mode" :defaultConfig="editorConfig" @onCreated="editorRef = $event" /></template>
适合谁: 中文项目、从 wangEditor 迁移、需要开箱即用且中文友好的场景。
UEditorPlus —— 百度 UEditor 的现代化重生
🔗 GitHub: modstart/ueditorplus[26] 🌐 官网: ueditorplus.com[27]
百度 UEditor 曾经是国内使用最广泛的富文本编辑器,但早已停止维护。UEditorPlus 由 ModStart 团队基于 UEditor 二次开发,让它焕然一新。
更新力度不小:全新 UI 视觉设计,字体图标替代老旧图片图标;集成了秀米编辑器和 135 编辑器,可同步微信公众号文章;支持 Word 文档和 Markdown 一键导入;v4.5.0 还加入了 AI 功能,支持 DeepSeek、OpenAI 等主流 AI 厂商接口,可以做内容续写、优化、生成。
使用方式(CDN 引入):
<scriptsrc="https://cdn.jsdelivr.net/npm/ueditor-plus/dist/ueditor.config.js"></script><scriptsrc="https://cdn.jsdelivr.net/npm/ueditor-plus/dist/ueditor.all.js"></script><divid="editor"type="text/plain"></div><script>UE.getEditor('editor', {initialFrameWidth: '100%',initialFrameHeight: 300, })</script>
优势:
-
从 UEditor 平滑迁移,学习成本低 -
集成秀米/135 编辑器,公众号排版友好 -
AI 功能支持多家厂商 -
Word/Markdown 导入 -
Apache 2.0 许可证,商用友好 -
活跃维护,2026 年仍在更新
劣势:
-
底层仍是 UEditor 老架构 -
基于 jQuery,非现代框架原生 -
包体积大 -
定制能力有限 -
依赖后端配置(上传等)
适合谁: 从 UEditor 迁移的老项目、需要公众号排版能力、传统后台管理系统。
五、其他值得关注
Jodit —— 简洁的原生编辑器
🔗 GitHub: xdan/jodit[28] 📦 npm:
jodit🌐 官网: xdsoft.net/jodit[29]
纯原生 JS,无框架依赖,TypeScript 支持,轻量易用。
npm install jodit
import'jodit/build/jodit.min.css'importJoditfrom'jodit'Jodit.make('#editor', {height: 300,})
Summernote —— Bootstrap 生态编辑器
🔗 GitHub: summernote/summernote[30] 📦 npm:
summernote🌐 官网: summernote.org[31]
基于 jQuery + Bootstrap 的经典编辑器,简单易用,适合传统项目。
<linkhref="summernote.min.css"rel="stylesheet"><scriptsrc="summernote.min.js"></script><script> $('#editor').summernote({ height: 300 })</script>
六、避坑名单:这些编辑器别在新项目用了
Draft.js —— 已进入维护模式
🔗 GitHub: facebook/draft-js[32]
Meta 的旧一代 React 编辑器框架,曾经流行一时。2023 年后基本无更新,Meta 官方推荐迁移至 Lexical。
新项目严禁使用,仅适用于已有遗留代码库的维护。
Summernote / Simditor —— 时代眼泪
🔗 Simditor GitHub: mycolorway/simditor[33](低活跃度)
基于 jQuery 的编辑器,在现代框架项目中集成困难。Summernote 仍在更新但技术栈过时,Simditor 低活跃度。仅建议遗留系统维护使用。
ContentTools / MediumEditor —— 已停更
轻量内联编辑器,已停止维护,不建议新项目使用。
七、30 秒快速选型
|
|
|
|---|---|
|
|
Tiptap |
|
|
Lexical |
|
|
Quill |
|
|
CKEditor 5
|
|
|
Editor.js |
|
|
Slate.js
|
|
|
TextBus |
|
|
UEditorPlus |
|
|
wangEditor-next |
|
|
Froala |
八、写在最后
选富文本编辑器,没有”最好”,只有”最合适”。
三个关键考量维度:
1. 维护状态优先。 一个停止维护的编辑器意味着安全漏洞无人修复、新框架兼容无人适配。Draft.js 和 wangEditor 的前车之鉴就在眼前。
2. 评估真实成本。 开源不等于免费——Tiptap 核心免费但协作要付费,CKEditor 的 GPL 许可证可能影响你的商业模式,Slate.js 免费但需要大量开发投入。
3. 匹配团队能力。 ProseMirror 功能最强但学习曲线极陡,Quill 开箱即用但定制困难。选你能驾驭的,而不是看起来最强的。
希望这份指南能帮你做出正确的选择。
引用链接
[1]ueberdosis/tiptap: https://github.com/ueberdosis/tiptap
[2]tiptap.dev: https://tiptap.dev
[3]facebook/lexical: https://github.com/facebook/lexical
[4]lexical.dev: https://lexical.dev
[5]slab/quill: https://github.com/slab/quill
[6]quilljs.com: https://quilljs.com
[7]ckeditor/ckeditor5: https://github.com/ckeditor/ckeditor5
[8]ckeditor.com/ckeditor-5: https://ckeditor.com/ckeditor-5/
[9]tinymce/tinymce: https://github.com/tinymce/tinymce
[10]tiny.cloud: https://www.tiny.cloud
[11]ianstormtaylor/slate: https://github.com/ianstormtaylor/slate
[12]docs.slatejs.org: https://docs.slatejs.org
[13]codex-team/editor.js: https://github.com/codex-team/editor.js
[14]editorjs.io: https://editorjs.io
[15]prosemirror/prosemirror: https://github.com/prosemirror/prosemirror
[16]prosemirror.net: https://prosemirror.net
[17]froala/wysiwyg-editor: https://github.com/froala/wysiwyg-editor
[18]froala.com: https://froala.com
[19]textbus/textbus: https://github.com/textbus/textbus
[20]textbus.io: https://textbus.io
[21]wangeditor-team/wangEditor: https://github.com/wangeditor-team/wangEditor
[22]undefined: https://www.wangeditor.com
[23]www.wangeditor.com: http://www.wangeditor.com
[24]wangeditor-next/wangeditor-next: https://github.com/wangeditor-next/wangeditor-next
[25]wangeditor-next.com: https://www.wangeditor-next.com
[26]modstart/ueditorplus: https://github.com/modstart/ueditorplus
[27]ueditorplus.com: https://www.ueditorplus.com
[28]xdan/jodit: https://github.com/xdan/jodit
[29]xdsoft.net/jodit: https://xdsoft.net/jodit/
[30]summernote/summernote: https://github.com/summernote/summernote
[31]summernote.org: https://summernote.org
[32]facebook/draft-js: https://github.com/facebook/draft-js
[33]mycolorway/simditor: https://github.com/mycolorway/simditor
夜雨聆风