Trix
What it is
Trix is a free, open-source WYSIWYG editor for composing messages, comments, articles, and lists in web applications. Its internal document model turns edits into operations and renders consistent HTML, while supporting embedded attachments. Default formatting includes bold, italic, links, strikethrough, headings, quotes, code, and numbered or bulleted lists. Editors provide unlimited undo and redo, form integration through a hidden input, and accessible names using label, aria-label, or aria-labelledby attributes. Files may be dropped or pasted, although the host application must upload them and supply permanent URLs. GIF, PNG, WebP, JPG, and JPEG files receive previews by default. Developers can customize the toolbar and add actions through events and data attributes. Trix supports evergreen desktop and mobile browsers, ESM and UMD bundles, npm CDN inclusion, and npm installation. The project is made by 37signals and uses an MIT license.
For and against
For
- Open source under MIT license
- Consistent HTML output
- Unlimited undo and redo
- Drag-and-drop and pasted file attachments
- ESM, UMD, and npm installation
Against
- Host application must upload attachments
- Permanent URLs are required for files
- Untrusted HTML can execute before sanitization
- Web application integration is required
The verdict
Trix provides a focused rich-text editor with structured content, attachments, and broad browser support. Developers should follow its security guidance and handle attachment uploads themselves.
Who it suits
Trix suits developers adding structured rich-text editing to web applications. It is useful when open-source licensing, browser delivery, attachments, and customizable controls matter.
Plans and prices
Trix
Open-source rich text editor; MIT license
Read 9 Oct 2026 · github.com
On the record
- Accessibility
- The editor supports labels, aria-label, and aria-labelledby attributes for an accessible name.github.com · read 9 Oct 2026
- Attachment previews
- Trix automatically previews GIF, PNG, WebP, JPG, and JPEG attachments by default.github.com · read 9 Oct 2026
- Attachments
- Trix accepts files dropped or pasted into the editor, but the application must upload them and provide a permanent URL.github.com · read 9 Oct 2026
- Attachments and HTML
- Trix supports embedded attachments and outputs terse, consistent HTML.trix-editor.org · read 9 Oct 2026
- Browser support
- Trix supports evergreen, self-updating desktop and mobile browsers.github.com · read 9 Oct 2026
- Customization
- Developers can customize the toolbar and add external actions through editor events and data attributes.github.com · read 9 Oct 2026
- Document model
- It uses an internal document model to turn editor input into editing operations and render the document back into the editor.github.com · read 9 Oct 2026
- Formatting
- Default formatting includes bold, italic, links, strikethrough, headings, quotes, code, and bulleted and numbered lists.github.com · read 9 Oct 2026
- Forms
- Trix can integrate with forms and update an associated hidden input whenever editor content changes.github.com · read 9 Oct 2026
- Installation
- Trix is available in ESM and UMD formats, can be included from an npm CDN, or installed as an npm package.github.com · read 9 Oct 2026
- Integration
- Trix can be included from an npm CDN or installed as an npm package, and is bundled in ESM and UMD formats.github.com · read 9 Oct 2026
- License
- The GitHub project identifies Trix as an open-source project and lists an MIT license.github.com · read 9 Oct 2026
- Maker
- Trix is made by 37signals, the creators of Ruby on Rails.github.com · read 9 Oct 2026
- Open source
- The project is open source and its GitHub repository identifies an MIT license.github.com · read 9 Oct 2026
- Output
- It uses a document model, supports embedded attachments, and outputs terse, consistent HTML.trix-editor.org · read 9 Oct 2026
- Purpose
- Trix is a WYSIWYG editor for composing messages, comments, articles, and lists in web applications.trix-editor.org · read 9 Oct 2026
- Sanitization
- Trix uses DOMPurify to sanitize editor content.github.com · read 9 Oct 2026
- Security guidance
- The documentation warns that untrusted HTML placed directly inside a trix-editor can execute before Trix sanitizes the editor value.github.com · read 9 Oct 2026