A Vaadin 25 Java integration for TinyMCE 7, a popular open-source rich text editor. The component implements HasValue and
works with Vaadin's data binding. Content value is plain HTML.
Add the dependency to your pom.xml:
<dependency>
<groupId>org.parttio</groupId>
<artifactId>tinymce-for-flow</artifactId>
<version>5.0.0</version>
</dependency>Create and use the editor:
TinyMce editor = new TinyMce();
editor.setValue("<p>Hello, world</p>");
// Or use a preconfigured setup
TinyMce basicEditor = new TinyMce()
.configureToolbar(true, Toolbar.BOLD, Toolbar.ITALIC, Toolbar.UNDERLINE)
.configurePlugin(true, Plugin.LISTS);TinyMCE 7 defaults to sandboxing any iframes in editor content with sandbox_iframes: true. If your content includes
iframes and they appear broken, disable sandboxing:
editor.configure("sandbox_iframes", false);If you cannot trust your users' HTML input, apply a converter that filters it (e.g., using the JSOUP library) before storing or displaying it.
When upgrading to version 5.x (Vaadin 25 / TinyMCE 7):
- Java 21 and Vaadin 25 are now required
- Plugin.ADVLIST is no longer needed — the
listsplugin handles it automatically - Plugin.TEMPLATE and Plugin.TABFOCUS are removed in TinyMCE 7
- Toolbar.FONTNAME has been renamed to Toolbar.FONT_FAMILY; new Toolbar.FONT_SIZE_INPUT is available
- sandbox_iframes defaults to
true— note if iframe content looks broken - Dialog usage: no special configuration needed anymore
mvn spring-boot:run -pl . -Dspring-boot.run.main-class=org.vaadin.tinymce.ApplicationDemo views are @Route-annotated classes in src/test/java. Access them at http://localhost:8080.
mvn test # Run all tests
mvn test -Dtest=MopoSmokeTest # Run a specific test classTests use Spring Boot with Playwright (via Mopo) for browser-based E2E testing.
To tag a release and increment versions:
mvn release:prepare release:cleanAnswer the prompts (defaults are usually fine). A GitHub Action automatically builds and deploys the release to Maven Central.
TinyMCE 6 is gone for a while now, so we decided to move on, too.
If you need Tiny 6 for license reasons, please have a look at HugeRTE, which is a fork of Tiny 6 and community maintained. Check out the Flow Addon for HugeRTE.
If HugeRTE is not an option, you can create your own version of this addon based on the v25_tiny6 branch.