A customizable TypeScript framework for building rich text editors on top of React, with a plugin-first, schema-less core.
facebook/lexical
An extensible text editor framework from Meta, with a framework-agnostic core and official React bindings.
- Stars
- 23,972
- Forks
- 2,257
- Open issues
- 359
- Last commit
- 6 hours ago
What is it?
Lexical is a text editor framework for building custom editing experiences in web applications. Its core is independent of any UI framework, and the project provides official React bindings alongside a plugin-based architecture for adding behavior and custom node types.
The editor keeps its state in an immutable model, which supports built-in undo and redo. It also handles import and export to JSON, Markdown and HTML, and includes support for tables, lists, code blocks, images and custom nodes. Real-time collaborative editing is available through integration with Yjs.
Lexical targets Chrome 86+, Firefox 115+, Safari 15+ and Edge 86+, and is written in TypeScript with type definitions included. The repository also contains a playground app and examples for plain text and rich text editors.
Key features
- 01Framework-agnostic core with official React bindings
- 02Immutable state model with built-in undo and redo
- 03Plugin-based architecture with extension points
- 04Import and export to JSON, Markdown and HTML
- 05Real-time collaboration via Yjs integration
- 06Written in TypeScript with type definitions
Use cases
- Adding a rich text editor to a React application
- Building a custom editor with custom node types
- Enabling real-time collaborative editing in a web app
- Converting editor content between HTML, Markdown and JSON
Quick start
- 1
Install Lexical with the React bindings
npm install lexical @lexical/react - 2
Create an editor with LexicalComposer and a content editable plugin, as shown in the README React example
Things to know
- Browser support is limited to recent versions such as Chrome 86+, Firefox 115+ and Safari 15+.
Topics
FAQ
- What is lexical?
- An extensible text editor framework from Meta, with a framework-agnostic core and official React bindings. Lexical is a text editor framework for building custom editing experiences in web applications. Its core is independent of any UI framework, and the project provides official React bindings alongside a plugin-based architecture for adding behavior and custom node types.
- Is lexical free to use? What license does it have?
- lexical is open source under the MIT license. Check the license terms before using it in commercial products.
- Is lexical still maintained?
- Actively maintained. The last commit to lexical was on Oct 21, 2026.
- What can I use lexical for?
- Adding a rich text editor to a React application Building a custom editor with custom node types Enabling real-time collaborative editing in a web app Converting editor content between HTML, Markdown and JSON
- How do I install lexical?
- Install Lexical with the React bindings: npm install lexical @lexical/react Create an editor with LexicalComposer and a content editable plugin, as shown in the README React example
- Where can I get lexical?
- The source code and installation instructions are on GitHub: https://github.com/facebook/lexical
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A headless, framework-agnostic rich text editor built on ProseMirror, extensible through a large set of extensions.
A block-style text editor for the web that saves content as clean JSON instead of HTML, extended through plugin tools.
An open-source virtual whiteboard for sketching hand-drawn style diagrams, with an embeddable React npm package.
Open-source all-in-one whiteboard with mind maps, flowcharts, freehand drawing, and images, built on the Plait framework.
A JavaScript library for predictable, maintainable global state management, usable with React or any other view library.