Trix is a browser rich text editor for messages, comments, and articles, with attachments and consistent HTML output for web applications.
Overview
Trix targets everyday rich text in web apps such as messages, comments, articles, and lists. It provides WYSIWYG editing with a toolbar, structured document model, embedded attachment support, and compact HTML output.
Instead of relying on browser execCommand inconsistencies, input is translated into edits on an internal document model and re-rendered to the editable surface. That design gives predictable behavior across evergreen desktop and mobile browsers.
The editor ships as ESM and UMD bundles for asset pipelines or npm imports, with default styles for toolbar and content. Custom elements integrate with forms via hidden fields or Element Internals, and support validation, accessibility labels, programmatic editing APIs, and file drag-and-drop attachments.
It is used in products from 37signals including Basecamp and HEY, and builds on web standards such as custom elements and mutation observers.
Key features
- WYSIWYG rich text editing
- Internal document model
- File attachment drag and drop
- Consistent HTML output
- Custom toolbar placement
- Form and validation integration
- ESM and UMD distribution
Use cases
- Comment and message composers
- Article editing in web apps
- Rich text with image attachments
- Replacing contenteditable-only editors