Get Started with LexKit
Build your first rich text editor in minutes
Follow this step-by-step guide to create powerful, type-safe rich text editors with LexKit. We'll cover installation, basic setup, theming, and extensions.
Try LexKit Live
Experience the power of LexKit with this interactive editor. Use the toolbar to format text, create lists, and explore features.
Install LexKit
npm install @lexkit/editorInstall Lexical Dependencies
npm install lexical @lexical/react @lexical/html @lexical/markdown @lexical/list @lexical/rich-text @lexical/selection @lexical/utilsReady to Code!
That's it! LexKit is now installed and ready to use. Let's create your first editor.
Option A: RichText as Extension
Use RichText as a LexKit extension with createEditorSystem for full type safety and modularity. RichTextExtension is built on top of Lexical's RichTextPlugin to make using the original tool easier.
RichText as LexKit Extension
Option B: Manual RichText Setup
Use createEditorSystem with manual RichTextPlugin setup for maximum control. You can also use RichTextPlugin from Lexical directly, but LexKit's RichTextExtension is built on top of it to make using the original Lexical tool easier.
Manual RichText Setup
Which to Choose?
- RichText as Extension: Use createEditorSystem with RichTextExtension for full type safety and modularity. Perfect for complex editors.
- Manual RichText Setup: Use createEditorSystem with manual RichTextPlugin setup for maximum control. Great for advanced customization.
LexKit is built around three core concepts that work together to give you complete control:
createEditorSystem
A factory function that creates a typed editor system based on your extensions. Provides full type safety.
Extensions
Modular pieces that add functionality like bold, italic, lists, images, etc. Mix and match as needed.
RichText
The core editor component that renders the editable content. Can be used standalone or with extensions.
Two Ways to Use LexKit
createEditorSystem with RichTextExtension for full type safety and modularity. Perfect for complex editors.createEditorSystem with manual RichTextPlugin setup for maximum control. Great for advanced customization.LexKit Theme System
Use LexKit's theme system to apply classnames to different editor elements for complete styling control.
LexKit Theme System
Themed Editor Example
See the theme system in action with custom classnames for each editor element.
This editor is styled entirely with Tailwind CSS classes — no custom CSS files needed!
Using Built-in Extensions
LexKit comes with 25+ extensions for common features. Here's how to use them:
Setup Extension System
Using Extension Commands
Access type-safe commands and state queries in your components:
Using Extension Commands
Available Extensions
Creating Custom Extensions
Create your own extensions for custom functionality:
Create Custom Extension
Keep Learning
Quick Wins
Ready to Build?
You've learned the fundamentals of LexKit. Now you can: