A powerful markdown editor and viewer component for Vaadin applications, built on the Toast UI Editor.
This addon provides two complementary components for working with markdown content in Vaadin:
- MarkdownEditor: A feature-rich editor for writing and previewing markdown
- MarkdownViewer: A read-only viewer for displaying rendered markdown
- WYSIWYG & Markdown View: Switch between visual preview and markdown editing
- Preview Modes: Choose between vertical split and tab-based views
- Theme Support: Auto-detecting light/dark theme with fallback option
- Form Integration: Full Vaadin binding support via
bindValue()
- Read-Only Display: Perfect for rendering user-submitted or stored markdown
- Theme Support: Seamless light/dark theme integration
<dependency>
<groupId>org.vaadin.addons.antlerflow</groupId>
<artifactId>markdown-editor</artifactId>
<version>${markdown-editor.version}</version>
</dependency>import org.vaadin.addons.antlerflow.markdowneditor.MarkdownEditor;
import org.vaadin.addons.antlerflow.markdowneditor.PreviewStyle;
MarkdownEditor editor = new MarkdownEditor("My Document");
editor.setWidthFull();
editor.setPreviewStyle(PreviewStyle.VERTICAL);
editor.setPlaceholder("Enter your markdown here...");
add(editor);import org.vaadin.addons.antlerflow.markdowneditor.MarkdownViewer;
MarkdownViewer viewer = new MarkdownViewer("Document Preview");
viewer.setValue("# Hello World\n\nThis is **markdown** content.");
add(viewer);MarkdownEditor editor = new MarkdownEditor("Document Content");
editor.setWidthFull();
// Bind to a value signal or property
ValueSignal<String> contentSignal = new ValueSignal<>("");
editor.bindValue(contentSignal, contentSignal::set);
// Access the content
String markdown = editor.getValue();Both components automatically detect and respond to the application's theme (light or dark). The theme is determined by:
- The
themeattribute on the document root element - CSS classes (
dark-theme,light-theme) on the document root - System preference (via
prefers-color-schememedia query if enabled)
editor.setUsePrefersColorSchemeFallback(true);
viewer.setUsePrefersColorSchemeFallback(true);Licensed under the Apache License 2.0. See the LICENSE file for details.
Contributions are welcome! Please ensure:
- Code follows the existing style conventions
- Changes include appropriate documentation
- Frontend changes compile without TypeScript errors
- Java changes compile without warnings
For issues, feature requests, or questions, please refer to the project's issue tracker.
Built by Antler Flow for the Vaadin community.
Toast UI Editor is provided by NHN Cloud.