Lexical is an extensible JavaScript web text-editor framework with an emphasis on reliability, accessibility, and performance. Currently at version 0.43.0, it follows a monthly release schedule, ensuring continuous improvements and bug fixes. The core of Lexical is a dependency-free engine, allowing for powerful, simple, and complex editor implementations to be built on top. Key differentiators include its framework-agnostic core (with official React bindings via `@lexical/react`), a plugin-based architecture for extensibility (rather than a monolithic approach), an immutable state model for time-travel capabilities, and robust support for collaborative editing via Yjs integration. It is designed to be highly customizable, enabling developers to create unique text editing experiences that scale in size and functionality, rather than being a ready-to-use editor with a predefined UI.
npm install lexicalVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up a basic rich-text editor using Lexical with React and TypeScript, including essential plugins like rich text editing, history, lists, links, and an auto-focus feature.
You must now manage Prism highlighting independently or provide your own implementation within `@lexical/code`'s API. Review `@lexical/code` documentation for updated guidelines.
Ensure any CSS or code setting `--lexical-indent-base-value` targets the editor's root element (e.g., the `LexicalComposer` container), not internal indented nodes.
Update your imports to `import { utilityName } from 'lexical';` instead of `import { utilityName } from '@lexical/utils';`.If you rely on `textFormat` or `textStyle` always being present in serialized JSON for `ElementNode`s, you may need to adjust your deserialization logic or ensure `TextNode` children exist when formatting is applied. These properties are recomputed on reconciliation.
Review custom `DecoratorNode` implementations and update them to align with the new API. Ensure your `decorate()` method signature is compatible with the widened type, if you had a stricter signature previously.
Users of `@lexical/yjs` must consult the official documentation for v0.36.1 and later to adapt to the new API, ensuring all node properties intended for syncing are initialized in the constructor, even if `undefined` initially.
Always perform editor state modifications within an `editor.update()` callback, where the state is temporarily mutable. Outside of these callbacks, treat editor states as immutable snapshots.
These utilities were moved to the main `lexical` package in v0.40.0. Update your imports to `import { utilityName } from 'lexical';`.Ensure that any code interacting with the Lexical editor context is rendered as a child of `LexicalComposer` and that the editor is fully initialized.
Review the `DecoratorNode` API in Lexical v0.36.1+. The `decorate()` method's type requirements were relaxed and widened. Adjust your custom `DecoratorNode` implementation, ensuring `decorate()` is present if your node requires it for rendering.
Add all custom nodes to the `nodes` array within the `editorConfig` object that is passed to `LexicalComposer` or `createEditor`.
No dependency data recorded yet.