stackpicks.dev
Back to gallery
facebook/lexical preview
facebook
facebook/

lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.

Stars
23.4k
Forks
2.2k
Watchers
23.4k
Open issues
467
TypeScriptMIT main Updated 6 hours ago~12 stars/day lifetime
Editor's take

Meta's extensible text editor framework. Used in Facebook and Instagram. More framework-y than Tiptap, steeper learning curve, more powerful for complex editors.

Use this if

You are building a complex editor with custom blocks and need maximum extensibility.

Skip if

You want fast adoption with sensible defaults — Tiptap.

Rich Text & Editors
Quick install
# Install via npm / pnpm / bun:
pnpm add lexical
# or
npm install lexical

Inferred from TypeScript · always double-check against the official README below.

README — rendered from facebook/lexical

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

  • Framework Agnostic Core - Works with any UI framework, with official React bindings
  • Reliable & Accessible - Built-in accessibility support and WCAG compliance
  • Extensible - Plugin-based architecture with powerful extension points
  • Immutable State Model - Time-travel ready with built-in undo/redo
  • Collaborative Editing - Real-time collaboration via Yjs integration
  • Serialization - Import/export from JSON, Markdown, and HTML
  • Rich Content - Support for tables, lists, code blocks, images, and custom nodes
  • Cross-browser - Firefox 115+, Safari 15+, Chrome 86+ (see Supported Browsers)
  • Type Safe - Written in TypeScript with comprehensive type definitions

Quick Start

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.

Live data via GitHub REST API · Cached 30 min · Created 04 Dec 2020
facebook/lexical — Live preview — StackPicks