lexical
Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
A TypeScript framework for building customizable rich-text editors in web apps. Assemble plugins to create editors like Notion or Google Docs.
Lexical is a toolkit for building text editors inside web applications. If you have ever wondered how apps like Notion, Google Docs, or a blog platform create their rich-text editing boxes — where you can bold text, add lists, insert images, and undo mistakes — Lexical is the kind of building block that powers those experiences.
Rather than a finished editor you drop in, Lexical is a framework: a set of low-level pieces developers assemble into whatever editor they need. It is plugin-based, meaning features like spell check, tables, or collaborative editing are added modularly rather than baked in. The core is framework-agnostic, though official bindings exist for React.
A key concept is its immutable state model — every change in the editor creates a new snapshot of the document state. This makes undo and redo reliable and also opens the door to real-time collaboration (multiple people editing the same document simultaneously), which it supports through integration with a library called Yjs.
You would use Lexical when you are building a web product that needs a text editor — a CMS, a note-taking app, a chat tool with formatting — and you want full control over how that editor behaves rather than being locked into a third-party widget.
It is written in TypeScript, published on npm, and created by Meta (Facebook).
Where it fits
- Build a collaborative note-taking app where multiple users can edit the same document in real time.
- Create a CMS with a custom rich-text editor that matches your brand's design and feature set.
- Add a formatted chat or comment system to your web app with bold, lists, and link support.
- Develop a Notion-like workspace with tables, embeds, and undo/redo powered by an immutable state model.