tinymce
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular
Top Related Projects
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
The next generation Javascript WYSIWYG HTML Editor.
Super simple WYSIWYG editor
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
A React framework for building text editors.
Quick Overview
TinyMCE is a popular open-source WYSIWYG (What You See Is What You Get) text editor written in JavaScript. It is designed to be embedded in web applications, providing users with a rich text editing experience within the browser. TinyMCE offers a wide range of features and customization options, making it a versatile choice for content management systems, blogging platforms, and other web-based applications that require advanced text editing capabilities.
Pros
- Extensive Feature Set: TinyMCE provides a comprehensive set of features, including formatting options, image and media insertion, table management, and more, allowing developers to create a rich text editing experience for their users.
- Customizability: TinyMCE can be extensively customized, with the ability to add or remove plugins, modify the user interface, and integrate with various frameworks and libraries.
- Cross-browser Compatibility: TinyMCE is designed to work seamlessly across a wide range of modern web browsers, ensuring a consistent user experience.
- Active Development and Community: TinyMCE is actively maintained and developed by a dedicated team, with a large and supportive community that contributes to its ongoing improvement and expansion.
Cons
- Learning Curve: While TinyMCE is powerful, its extensive feature set and customization options can present a steeper learning curve for some developers, especially those new to the library.
- Performance Overhead: Depending on the specific use case and the number of features enabled, TinyMCE can add some performance overhead to web applications, which may be a concern for projects with strict performance requirements.
- Licensing Considerations: TinyMCE offers both a free, open-source version and a commercial version with additional features and support. Developers need to carefully consider the licensing implications for their project.
- Dependency Management: TinyMCE is a standalone library, which means it may require additional effort to integrate it with certain frameworks or libraries, depending on the project's architecture.
Code Examples
// Initialize TinyMCE with a basic configuration
tinymce.init({
selector: 'textarea.tinymce',
plugins: 'link image code',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code'
});
This code initializes TinyMCE on all textarea
elements with the class tinymce
, enabling the link
, image
, and code
plugins, and providing a basic toolbar with common formatting options.
// Customize the TinyMCE toolbar and add a custom plugin
tinymce.init({
selector: 'textarea.tinymce',
plugins: 'link image code myCustomPlugin',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | myCustomButton | code',
setup: function (editor) {
editor.ui.registry.addButton('myCustomButton', {
text: 'My Custom Button',
onAction: function (_) {
editor.insertContent(' <strong>Custom content inserted!</strong> ');
}
});
}
});
This example demonstrates how to customize the TinyMCE toolbar by adding a custom plugin and a button that inserts custom content into the editor.
// Integrate TinyMCE with a React component
import React, { useRef } from 'react';
import { Editor } from '@tinymce/tinymce-react';
const MyEditor = () => {
const editorRef = useRef(null);
const log = () => {
if (editorRef.current) {
console.log(editorRef.current.getContent());
}
};
return (
<>
<Editor
onInit={(evt, editor) => (editorRef.current = editor)}
initialValue="<p>This is the initial content of the editor.</p>"
init={{
height: 500,
menubar: false,
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste code help wordcount'
],
toolbar:
'undo redo | format
Competitor Comparisons
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Pros of CKEditor 5
- More modern architecture with a modular plugin system
- Better out-of-the-box support for collaborative editing
- Stronger focus on accessibility and compliance with WCAG 2.1
Cons of CKEditor 5
- Steeper learning curve for developers due to its complex architecture
- Smaller ecosystem of third-party plugins compared to TinyMCE
- More restrictive licensing terms for commercial use
Code Comparison
CKEditor 5:
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
ClassicEditor
.create(document.querySelector('#editor'))
.then(editor => {
console.log('Editor was initialized', editor);
})
.catch(error => {
console.error(error);
});
TinyMCE:
tinymce.init({
selector: '#editor',
plugins: 'link image code',
toolbar: 'undo redo | bold italic | link image | code',
setup: function(editor) {
console.log('Editor was initialized', editor);
}
});
Both editors offer rich text editing capabilities, but CKEditor 5 uses a more modern, promise-based initialization approach, while TinyMCE uses a configuration object. CKEditor 5's modular structure allows for more customization, but TinyMCE's simpler setup might be preferable for quick implementations.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Pros of Quill
- Lightweight and modular architecture
- Better performance for large documents
- More modern and customizable UI
Cons of Quill
- Smaller ecosystem and fewer plugins
- Less extensive documentation
- Limited support for older browsers
Code Comparison
TinyMCE (initialization):
tinymce.init({
selector: '#editor',
plugins: 'link image table',
toolbar: 'undo redo | formatselect | bold italic'
});
Quill (initialization):
var quill = new Quill('#editor', {
modules: { toolbar: true },
theme: 'snow'
});
Both TinyMCE and Quill are popular rich text editors for web applications. TinyMCE offers a more extensive feature set and wider browser support, making it suitable for enterprise applications. It has a larger ecosystem with numerous plugins and integrations.
Quill, on the other hand, provides a more modern and customizable approach. It's lighter and performs better with large documents. Quill's modular architecture allows for easier customization and extension.
TinyMCE has more comprehensive documentation and a larger community, which can be beneficial for troubleshooting and support. Quill's documentation, while sufficient, is not as extensive.
In terms of code, both editors offer straightforward initialization, but Quill's API is generally considered more intuitive and easier to work with for developers.
The next generation Javascript WYSIWYG HTML Editor.
Pros of Froala Editor
- Lightweight and faster loading compared to TinyMCE
- More modern and visually appealing default UI
- Easier to customize and extend with plugins
Cons of Froala Editor
- Commercial license required for most use cases
- Smaller community and fewer third-party resources
- Less extensive documentation compared to TinyMCE
Code Comparison
TinyMCE initialization:
tinymce.init({
selector: 'textarea',
plugins: 'link image table',
toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | link image'
});
Froala Editor initialization:
new FroalaEditor('#editor', {
toolbarButtons: ['bold', 'italic', 'underline', 'strikeThrough', 'align', 'insertLink', 'insertImage', 'insertTable'],
pluginsEnabled: ['link', 'image', 'table']
});
Both editors offer similar core functionality, but Froala's initialization syntax is more concise. TinyMCE provides more granular control over plugins and toolbar options out of the box, while Froala focuses on a streamlined setup process. The choice between the two often depends on specific project requirements, budget constraints, and desired customization level.
Super simple WYSIWYG editor
Pros of Summernote
- Lightweight and easy to integrate
- Built on Bootstrap, offering a familiar and responsive design
- Simple API and customization options
Cons of Summernote
- Less feature-rich compared to TinyMCE
- Limited plugin ecosystem
- Less frequent updates and maintenance
Code Comparison
TinyMCE initialization:
tinymce.init({
selector: 'textarea',
plugins: 'link image code',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code'
});
Summernote initialization:
$('#summernote').summernote({
height: 300,
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['para', ['ul', 'ol', 'paragraph']]
]
});
Both editors offer straightforward initialization, but TinyMCE provides more extensive configuration options out of the box. Summernote's setup is simpler and relies on jQuery, while TinyMCE is a standalone library with a more comprehensive feature set.
TinyMCE generally offers more advanced features and customization options, making it suitable for complex projects. Summernote, on the other hand, is more lightweight and easier to implement for simpler use cases, especially when working with Bootstrap-based projects.
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
Pros of medium-editor
- Lightweight and minimalistic, with a smaller footprint than TinyMCE
- Easier to customize and extend due to its simpler architecture
- More modern, Medium-like editing experience out of the box
Cons of medium-editor
- Less feature-rich compared to TinyMCE's extensive plugin ecosystem
- Limited browser compatibility, especially for older versions
- Less frequent updates and maintenance compared to TinyMCE
Code Comparison
medium-editor:
var editor = new MediumEditor('.editable', {
toolbar: {
buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote']
}
});
TinyMCE:
tinymce.init({
selector: 'textarea',
plugins: 'link image code',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code'
});
The code snippets demonstrate the initialization process for both editors. medium-editor focuses on a more streamlined setup with a simple toolbar configuration, while TinyMCE offers a more comprehensive initialization with plugins and a wider range of toolbar options.
A React framework for building text editors.
Pros of Draft.js
- More lightweight and flexible, allowing for custom UI and behavior
- Better suited for React-based applications
- Offers immutable data structures for improved performance
Cons of Draft.js
- Steeper learning curve, especially for developers new to React
- Less out-of-the-box functionality compared to TinyMCE
- Requires more custom development for advanced features
Code Comparison
Draft.js:
import { Editor, EditorState } from 'draft-js';
const [editorState, setEditorState] = useState(EditorState.createEmpty());
<Editor editorState={editorState} onChange={setEditorState} />
TinyMCE:
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"></script>
<script>
tinymce.init({
selector: '#myTextarea'
});
</script>
<textarea id="myTextarea"></textarea>
Summary
Draft.js is a powerful, flexible rich text editor framework that integrates well with React applications. It offers more control over the editing experience but requires more development effort. TinyMCE, on the other hand, provides a more complete out-of-the-box solution with a wider range of features and easier implementation for non-React projects. The choice between the two depends on the specific project requirements, development resources, and the desired level of customization.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
TinyMCE
The world's #1 open source rich text editor.
Using an old version of TinyMCE? We recommend you to upgrade to TinyMCE 7 to continue receiving security updates, or consider TinyMCE 5 LTS if you need more time to upgrade.
Used and trusted by millions of developers, TinyMCE is the worldâs most customizable, scalable, and flexible rich text editor. Weâve helped launch the likes of Atlassian, Medium, Evernote (and lots more that we canât tell you), by empowering them to create exceptional content and experiences for their users.
With more than 350M+ downloads every year, weâre also one of the most trusted enterprise-grade open source HTML editors on the internet. Thereâs currently more than 100M+ products worldwide, powered by Tiny. As a high powered WYSIWYG editor, TinyMCE is built to scale, designed to innovate, and thrives on delivering results to difficult edge-cases.
You can access a full featured demo of TinyMCE in the docs on the TinyMCE website.
Get started with TinyMCE
Getting started with the TinyMCE rich text editor is easy, and for simple configurations can be done in less than 5 minutes.
TinyMCE Cloud Deployment Quick Start Guide
TinyMCE Self-hosted Deployment Guide
TinyMCE provides a range of configuration options that allow you to integrate it into your application. Start customizing with a basic setup.
Configure it for one of three modes of editing:
Features
Integration
TinyMCE is easily integrated into your projects with the help of components such as:
With over 29 integrations, and 400+ APIs, see the TinyMCE docs for a full list of editor integrations.
Customization
It is easy to configure the UI of your rich text editor to match the design of your site, product or application. Due to its flexibility, you can configure the editor with as much or as little functionality as you like, depending on your requirements.
With 50+ powerful plugins available, and content editable as the basis of TinyMCE, adding additional functionality is as simple as including a single line of code.
Realizing the full power of most plugins requires only a few lines more.
Extensibility
Sometimes your editor requirements can be quite unique, and you need the freedom and flexibility to innovate. Thanks to TinyMCE being open source, you can view the source code and develop your own extensions for custom functionality to meet your own requirements.
The TinyMCE API is exposed to make it easier for you to write custom functionality that fits within the existing framework of TinyMCE UI components.
Extended Features and Support
For the professional software teams that require more in-depth efficiency, compliance or collaborative features built to enterprise-grade standards, please get in touch with our team.
Tiny also offers dedicated SLAs and support for professional development teams.
Compiling and contributing
In 2019 the decision was made to transition our codebase to a monorepo. For information on compiling and contributing, see: contribution guidelines.
As an open source product, we encourage and support the active development of our software.
Want more information?
Visit the TinyMCE website and check out the TinyMCE documentation.
License
Licensed under the terms of GNU General Public License Version 2 or later. For full details about the license, please check the LICENSE.md file.
Top Related Projects
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
The next generation Javascript WYSIWYG HTML Editor.
Super simple WYSIWYG editor
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
A React framework for building text editors.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot