React Examples
Plain Text Editor
Simple plaintext editor with history and accessibility. Perfect starting point for basic text editing.Features:
@lexical/plain-text, @lexical/history, @lexical/dragonTry on StackBlitzRich Text Editor
Rich text editor with formatting, history, and accessibility support.Features:
@lexical/rich-text, @lexical/history, @lexical/dragonTry on StackBlitzTable Plugin
Demonstrates table functionality with cell selection, formatting, and basic table operations.Features: Rich text, table plugin, toolbar with table controlsTry on StackBlitz
Collaboration (Yjs)
Real-time collaboration setup using Yjs for multi-user editing.Features: Collaboration via
@lexical/yjs, WebSocket server, cursor syncingTry on StackBlitzVanilla JavaScript Examples
Basic Vanilla JS
Framework-agnostic implementation showing Lexical’s core capabilities without React.Features: Rich text, history, accessibility in pure JavaScriptTry on StackBlitz
Custom Plugin
Emoji plugin demonstrating custom nodes and transforms. Replaces text like
:) with emoji graphics.Demonstrates: Custom TextNode extension, node transforms, plugin architectureTry on StackBlitziframe Integration
Shows how to use Lexical inside an iframe, useful for sandboxed editing environments.Features: Rich text within iframe, cross-document editingTry on StackBlitz
Advanced Examples
Node Replacement
Demonstrates how to replace built-in nodes with custom implementations (CustomParagraphNode).Demonstrates: Node replacement pattern, extending core nodesTry on StackBlitz
Node State & Styling
Shows how to use NodeState for custom node properties and dynamic styling.Demonstrates: NodeState API, custom properties, CSS integration
Lexical Extension Examples
Lexical Extension is an experimental API that provides a modern, signal-based approach to building editors.
Extension Table (React)
Table plugin built with Lexical Extension API in React.Features: Extension-based architecture, reactive signalsTry on StackBlitz
SvelteKit SSR
Server-side rendering with hydration in SvelteKit using Extension signals.Demonstrates: SSR/hydration, Svelte Store API compatibility, Vite HMRTry on StackBlitz
Vanilla + Tailwind
Vanilla JavaScript with Tailwind CSS styling using Extension API.Features: Extension signals, Tailwind integration
React Plugin Host
Demonstrates hosting React plugins within a vanilla Extension-based editor.Demonstrates: Framework interop, plugin architecture
Running Examples Locally
All examples can be run locally with:Using Examples as Templates
Each example is self-contained and can serve as a starting point:- Copy the example directory
- Update
package.jsonwith your project details - Modify the editor configuration to suit your needs
- Add additional plugins and features