For the interactive demo, see the Playground. The beta (0.5.0-beta.4) is published on npm.
Versatility will be our differentiator. Precision will be our reputation.
Preserve the past. Improve the present. Do not limit the future.
This software is in beta.
The public API may change before version 1.0. Known limitations are listed below; please report problems on GitHub.
VersaEdit is a lightweight, open-source rich text editor for React web applications. It edits HTML with the browser’s own contentEditable and adds a toolbar, sanitization with DOMPurify, its own undo and redo history, cleanup of content pasted from web pages and Microsoft Word, images, text boxes, dictation and saving or opening .html files.[1]
The editor has no backend dependency: it hands the application plain HTML, to be stored wherever the developer chooses, such as Supabase, Firebase or any REST service. It supports React 18.3 and 19 and server rendering (tested with Next.js), and ships an English, a Brazilian Portuguese and a Spanish interface, in which every text can be replaced.
Development started in 2026. VersaEdit is free software, published under the MIT License.
Features
- Text formatting, fonts and sizes, text and highlight colors, paper color, headings, quotes, lists, indentation, links and horizontal rules.
- Font menu in groups: system fonts, an optional pack of 25 free Google Fonts and your own font files, with helpers that load on the published page only the fonts it uses.
- Format painter: copies the formatting of one piece of text to others, once or until Esc.
- Images (with an optional upload callback) and text boxes that can be moved, resized and floated, with adjustable margins around them.
- Pasting from web pages and Word: tables keep their structure, and paragraph spacing can be kept, as in the original document.
- Optional Layout Mirror: published content keeps the same layout seen while editing.
- Its own undo and redo history, keyboard shortcuts and a keyboard-navigable toolbar (WAI-ARIA).
- Dictation with spoken punctuation, using the speech recognition of Chrome, Edge and Safari.
- Configurable toolbar groups, fluid width, a scrolling, fixed-height or resizable editing area, an optional settings panel opened from a gear on the toolbar, and replaceable interface texts.
Installation
VersaEdit is an ES module with TypeScript types, published on npm as a beta (0.5.0-beta.4).
npm install versaedit@betaStep-by-step setup with a complete React example: Quick Start.
Usage
import { VersaEdit } from 'versaedit'
<VersaEdit
initialContent={html}
onChange={setHtml}
width="100%"
height={500}
locale="en"
/>
Styling
The editor injects its own stylesheet by default. Sites with a strict Content Security Policy can turn injection off with injectStyles={false} and import versaedit/versaedit.css. Saved content is displayed with versaedit-content.css inside a .versaedit-content wrapper.[2]
Security
All incoming HTML, including initial content, opened files and pasted content, passes through DOMPurify and the editor’s own allow-lists, and a battery of 42 XSS vectors runs in continuous integration. Because the editor runs in the user’s browser, applications must sanitize again on the server before storing or publishing; the integration guide includes a tested recipe.[2]
Browser support
| Browser | Status | Notes |
|---|---|---|
| Chrome, Edge (desktop) | Supported | Automated test suite in continuous integration (Chromium engine), with React 18 and 19. |
| Firefox (desktop) | Works, with differences | Diagnostic test runs only. Small HTML differences (for example, an inserted image is placed inside the paragraph). The bold, italic and underline shortcuts (Ctrl+B/I/U) work; they were checked in local diagnostic runs and on the published site. The Word paste tests do not run in Firefox. Dictation is not available. |
| Safari | Works, with differences | Diagnostic test runs only, with the WebKit engine, not in Safari itself. Lists receive extra font-size spans; other HTML differences are cosmetic (how styles are written). Loading external audio and video, when enabled (allowExternalMedia), was not verified. |
| Mobile browsers | Not validated | Touch input is supported (tested by emulation in Chromium); not yet tested on real phones or tablets. |
Limitations
- Built on
document.execCommand: the HTML produced varies slightly between browsers. - Undo and redo: after undoing in the editor, the browser’s own Redo (Edit or context menu) may be unavailable; Ctrl+Y and the Redo button work. Typing with system IME keyboards (Japanese, Chinese, Korean) and Safari’s menus have not yet been checked by hand.
- After the highlighter or a custom color, bold is saved as
<span style="font-weight: bold">instead of<b>(it displays the same). - Text flows around a floated image or text box on one side only (a CSS float limitation).
- Pasting from Microsoft Word is supported and covered by automated tests with HTML samples; compatibility with a range of real documents has not yet been validated systematically.
- One selection at a time: selecting several pieces of text with Ctrl is not supported.
- Output is HTML only, with no JSON or Markdown export.
See also
References
- VersaEdit README, github.com/WattsBR/versaedit.
- Integration guide: sanitization in the browser and on the server.
- CHANGELOG: version 0.5.0-beta.4.