COMPARISON · RICH TEXT EDITOR

lexical vs. prosemirror-state

Side-by-side comparison · 9 metrics · 14 criteria

lexical v0.49.0 · MIT
Weekly Downloads
3.8M
Stars
23.7K
Gzip Size
60.2 kB
License
MIT
Last Updated
5mo ago
Open Issues
358
Forks
2.2K
Unpacked Size
3.3 MB
Dependencies
1
prosemirror-state v1.4.4 · MIT · ARCHIVED
Weekly Downloads
14.0M
Stars
232
Gzip Size
19.6 kB
License
MIT
Last Updated
9mo ago
Open Issues
0
Forks
74
Unpacked Size
184.0 kB
Dependencies
4
DOWNLOAD TRENDS

lexical vs prosemirror-state downloads — last 12 months

Download trends for lexical and prosemirror-state2 download series from Aug 2025 to Jul 2026. Use left and right arrow keys to inspect monthly values.016.8M33.7M50.5M67.3MAug 2025NovFebMayJul 2026
lexical
prosemirror-state
FEATURE COMPARISON

Criteria — lexical vs prosemirror-state

API Style
lexical
More imperative, command-oriented.
prosemirror-state
More functional, transaction-oriented.
Data Structure
lexical
Tree of mutable nodes.
prosemirror-state
Immutable document object.
Core Philosophy
lexical
Composable, extensible framework for rich text.
prosemirror-state
Declarative toolkit for editor state and transformations.
Primary Audience
lexical
Teams building complex, customizable editing platforms.
prosemirror-state
Developers needing fine-grained control over editor state.
Rich Feature Set
lexical
Comprehensive out-of-the-box features for editing.
prosemirror-state
Provides core state logic; UI and features built by consumer.
Performance Focus
lexical
Excellent editor performance, balanced with features.
prosemirror-state
Highly optimized for state operations, prioritizes minimal overhead.
Customization Depth
lexical
High through plugins and framework APIs.
prosemirror-state
Very high due to foundational nature and schema control.
Tooling & Ecosystem
lexical
More complete framework with dedicated UI components.
prosemirror-state
Core state library, ecosystem relies on composing related packages.
Accessibility Features
lexical
Core design principle with built-in support.
prosemirror-state
Relies on implementation; not a primary focus of the state package.
Bundle Size Efficiency
lexical
Larger footprint at 60.2 kB (gzip).
prosemirror-state
Minimal footprint at 19.6 kB (gzip).
Extensibility Approach
lexical
Integrated plugin system for commands, key bindings, UI.
prosemirror-state
Composition of core modules and schema-driven plugins.
Initial Learning Curve
lexical
Potentially quicker for imperative JavaScript developers.
prosemirror-state
Steeper initially due to immutable state and transactions.
State Management Model
lexical
Mutable, node-based tree structure.
prosemirror-state
Immutable document structure with transaction system.
Debugging Predictability
lexical
Can be complex with mutable state updates.
prosemirror-state
High predictability due to immutable state management.
VERDICT

Lexical is designed as a highly composable and extensible rich text editor framework, aiming for robust reliability, accessibility, and performance. Its core philosophy centers on providing a flexible foundation that developers can build upon extensively, making it suitable for complex applications requiring deep customization of the editing experience. The primary audience includes teams building sophisticated content editing platforms, C2A document editors, or in-app rich text UIs where a feature-rich and adaptable editor is paramount.

ProseMirror, particularly the `prosemirror-state` package, is a toolkit for building rich text editors. Its philosophy emphasizes a declarative approach to defining editor state and transformations, focusing on data integrity and advanced text manipulation capabilities. It's geared towards developers who need fine-grained control over the editor's internal state and operations, often for highly specialized editing domains or where a robust, self-contained state management solution is critical. The audience often consists of developers building custom editors with specific data schemas or complex editing logic.

A key architectural difference lies in their approach to state management and data representation. Lexical employs a mutable node-based tree structure for its editor state, which allows for direct manipulation and often leads to a more imperative programming model for handling changes. This can feel intuitive for developers accustomed to direct DOM manipulation paradigms. ProseMirror, on the other hand, utilizes a more functional and declarative approach, representing the editor content as a truly immutable document structure and managing changes through a transaction system. This immutability is central to its design, ensuring predictable state updates.

Another significant technical difference is in their extensibility and plugin models. Lexical features a powerful plugin system that allows developers to inject new commands, key bindings, and UI components directly into the editor's core. This can lead to a highly integrated extension experience. ProseMirror's extensibility is often achieved by composing its core modules and managing editor behavior through a schema definition and plugins that dispatch transactions. This often involves a deeper understanding of ProseMirror's transaction pipeline and state update mechanisms for creating new features.

Developer experience can vary significantly due to these architectural choices. Lexical, with its mutable state and command-based API, might offer a quicker initial ramp-up for developers familiar with imperative JavaScript. Its focus on accessibility and performance is built-in. ProseMirror, with its immutable state and transaction-centric model, can present a steeper learning curve initially. However, for those who master its concepts, the predictable state management can significantly simplify debugging complex editing interactions and ensure data consistency over time. Lexical's rich ecosystem and clearer path for UIs might appeal to those prioritizing rapid UI development.

Performance and bundle size considerations favor `prosemirror-state` significantly. While Lexical offers excellent performance for rich text editing, its overall footprint is considerably larger, indicated by its 3.3 MB unpacked size and 60.2 kB gzipped bundle size. `prosemirror-state` is exceptionally lean, with an unpacked size of 184.0 kB and a gzipped bundle size of just 19.6 kB. This makes `prosemirror-state` a compelling choice for projects where minimizing bundle size is a critical requirement, such as progressive web applications or performance-sensitive client-side UIs.

Practically, consider lexical for a feature-rich, accessible, and highly customizable in-app rich text editor where you want a framework that abstracts away many common editing complexities and provides a robust plugin system for extending functionality. Use it when building modern web applications that require a polished editing experience out-of-the-box with significant potential for future growth and feature additions. Its large community and comprehensive feature set make it ideal for established projects or new ones aiming for a best-in-class rich text editing solution.

Choose `prosemirror-state` for projects where minimizing JavaScript payload is a top priority, or when you need a highly specialized, low-level editor state management solution. It's particularly well-suited for frameworks where you are building your own editor components and need a reliable, immutable state engine. If your project involves complex document structures, custom data transformations, or requires absolute control over editor updates and rendering, `prosemirror-state` provides a powerful and efficient foundation.

Lexical's focus on accessibility and its comprehensive set of built-in features, such as collaboration support, make it a strong contender for applications that need to cater to a wide range of users and use cases. Its roadmap often includes forward-looking features that align with modern web development trends. `prosemirror-state`, by comparison, offers a more foundational toolkit. While it's less opinionated about the final rendered output or UI layer, it provides a stable and well-tested core for building everything from simple text inputs to complex document editors, relying on the developer to integrate it into their specific application architecture.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

RELATED COMPARISONS 6
lexical vs quill ★ 71.0K · 13.0M/wk lexical vs slate ★ 55.5K · 6.2M/wk @tiptap/core vs lexical ★ 61.6K · 17.5M/wk prosemirror-state vs slate ★ 32.0K · 16.4M/wk prosemirror-state vs quill ★ 47.5K · 23.2M/wk @tiptap/core vs prosemirror-state ★ 38.1K · 27.7M/wk