Skip to content

Lexical

An extensible text editor framework for building rich text editors in web apps.

Stars
24k
Forks
2.3k
Licence
MIT
Language
TypeScript
Last update
4 days ago
Type
Library

What it is

Lexical is a framework from Meta for building text editors inside web applications. It is a toolkit rather than a finished editor, so developers use it to create editing experiences with features like lists, tables, code blocks, and undo/redo. The README says it works with any UI framework and offers official React bindings.

  • Build a plain text input with the PlainTextPlugin and ContentEditable components
  • Create a rich text editor with lists, code blocks, images, and custom nodes
  • Add real-time collaborative editing using the Yjs integration
  • Export editor content to Markdown, HTML, or JSON

Great for

  • Developers adding a rich text editor to a web app
  • React teams who want official bindings and a documented quick start
  • Projects that need real-time collaboration through Yjs integration
  • Teams that want import/export to JSON, Markdown, or HTML

Not ideal for

  • Non-developers looking for a ready-made word processor, since it is a framework with no standalone end-user app described in the README
  • Projects that must support very old browsers, since it lists Chrome 86+, Firefox 115+, and Safari 15+
Step-by-step guide: how to use LexicalInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js · npm or pnpm

    Install Lexical with React bindings

    npm install lexical @lexical/react

    Install dependencies for development

    pnpm install
  2. 2

    Run it

    • Install the lexical and @lexical/react packages with npm
    • Copy the React example from the Quick Start into your app
    • Wrap the editor in LexicalComposer with an initialConfig object
    • Add PlainTextPlugin or a rich text setup, plus HistoryPlugin for undo/redo
  3. 3

    Get the most out of it

    • Read the Vanilla JS quick start if you do not use React
    • Explore the examples folder for sample implementations
    • Use the Playground (pnpm run start) to see working features locally
    • Review the API reference at lexical.dev/docs/api

Downloads

Strengths

  • Built-in accessibility support and WCAG compliance, per the README
  • Framework-agnostic core with official React bindings
  • Written in TypeScript with type definitions

Trade-offs

  • Requires building your own editor UI from plugins and components, which takes development effort
  • Browser support is limited to the listed recent versions

How it compares

ProjectStarsTypeLevelUpdatedBest for
lexical (this)24kLibraryintermediate4 days agoDevelopers adding a rich text editor to a web app
slate31.7kFrameworkadvanced8 days agoDevelopers building a custom rich text editor inside a web app
tiptap38.9kLibraryintermediate4 days agoDevelopers building a custom text editor into a web product

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.