Official Web Component integration for TinyMCE, the rich text editor. Web Components are a set of native browser APIs — Custom Elements, Shadow DOM, and HTML Templates — that let you build reusable, framework-agnostic HTML elements. This package wraps TinyMCE as a <tinymce-editor> custom element, used in place of calling tinymce.init(). Once installed on a page, creating an editor is as simple as adding a <tinymce-editor></tinymce-editor> tag, with many of the standard configuration properties can be specified as attributes. By default, it pulls TinyMCE from the Tiny Cloud CDN unless configured to use a different setup, such as self-hosting the tinymce NPM package.
- Sign up for a Tiny Cloud account to receive a Tiny Cloud API key.
- Then in your project:
-
Include the following script tag to load the Web Component integration from the CDN:
<script src="https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent/dist/tinymce-webcomponent.min.js"></script>
-
Add the
tinymce-editorelement with your API key and configuration as HTML attributes:<tinymce-editor api-key="your-api-key" plugins="lists link image table code help wordcount" > <p>Welcome to TinyMCE</p> </tinymce-editor>
-
Update the
api-keyattribute to include your Tiny Cloud API key.
-
For more information: Using TinyMCE with Web Component - Cloud CDN
Using TinyMCE from NPM with the Web Component integration requires a couple of extra steps. See the documentation for more information: Using TinyMCE with Web Component - Self hosted via NPM
Have you found an issue with tinymce-webcomponent or do you have a feature request? Open up an issue and let us know or submit a pull request. Note: for issues concerning TinyMCE please visit the TinyMCE repository.
tinymce-webcomponent is licensed under the MIT License. See the LICENSE.txt file for details.
Depending on use case, the TinyMCE core editor can be used under either GPL-2.0-or-later or a commercial license. See the tinymce package for details.