lexical README

The project's README from github.com/facebook/lexical. As one markdown file: README.md.

Lexical

An extensible text editor framework that provides excellent reliability, accessibility and performance.

NPM Version NPM Downloads Build Status Discord

Documentation | Getting Started | Playground | Gallery


Features

Quick Start

For framework-agnostic usage, start with the Vanilla JS quick start or the Vanilla JS example.

For React applications, install Lexical with the official React bindings:

npm install lexical @lexical/react
import { $getRoot, $getSelection } from 'lexical';
import { LexicalComposer } from '@lexical/react/LexicalComposer';
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';

const initialConfig = {
  namespace: 'MyEditor',
  onError: (error) => console.error(error),
};

function Editor() {
  return (
    <LexicalComposer initialConfig={initialConfig}>
      <PlainTextPlugin
        contentEditable={<ContentEditable />}
        ErrorBoundary={LexicalErrorBoundary}
      />
      <HistoryPlugin />
    </LexicalComposer>
  );
}

Try it yourself:

Development

# Install dependencies
pnpm install

# Start playground dev server
pnpm run start

# Run tests
pnpm run test-unit
pnpm run test-e2e-chromium

# Lint and type check
pnpm run ci-check

See CONTRIBUTING.md for detailed development guidelines.

Documentation

Community & Support

Browser Support

Browser Version
Chrome 86+
Firefox 115+
Safari 15+
Edge 86+

Contributors

We welcome contributions! Please read our Contributing Guide to learn about our development process and how to propose bugfixes and improvements.

License

MIT License Copyright ©2026 Meta Platforms, Inc.

lexical (facebook/lexical)

wysiwyg
Searching Database…

What is this?Lexical is an extensible text editor framework for the web from Meta, built for reliability, accessibility and performance. You use it to build your own rich-text editors in the browser.
Is it a finished editor I can drop in, or something I build on?It is a framework rather than a turnkey app: a framework-agnostic core that you assemble into an editor out of plugins, with official bindings for React.
How do I get it into my project?Install the core from npm and add the layer for your stack — React apps use the official @lexical/react bindings, and there is a Vanilla JS quick start too. Docs are at lexical.dev.
Am I locked into React to use it?No — the core works with any UI framework; React is just the first-party option, and a Vanilla JS path exists for everything else.
Are there browser version requirements I should know about?It targets modern browsers only: Chrome 86+, Edge 86+, Firefox 115+ and Safari 15+. No support for legacy browsers is offered.
What content types does it support out of the box?Tables, lists, code blocks and images work out of the box, and the plugin architecture lets you define custom nodes for anything beyond that.
How does undo and redo work?State is immutable and time-travel ready, so undo and redo are built in rather than something you wire up yourself.
Can I try it before wiring it into my app?Yes — the repo ships a playground plus plain-text and rich-text example editors, and the docs at lexical.dev include live examples.
How seriously does it take accessibility?It is a headline feature: built-in accessibility support with WCAG compliance, one of the main reasons to pick it over rolling your own editor.
What are similar projects?ckeditor5, slate, BlockNote, plate, tiptap, tui.editor, trix, editor.js
Creator
facebook
Size
144.5 MB
Stars
24K
Age
5y
Commits · 90 Days