Socket
Socket
Sign inDemoInstall

lexical

Package Overview
Dependencies
Maintainers
6
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lexical

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


Version published
Weekly downloads
514K
decreased by-10.46%
Maintainers
6
Weekly downloads
 
Created

What is lexical?

Lexical is a modern, extensible text editor framework that provides a set of tools and APIs to build rich text editors with ease. It is designed to be highly performant, flexible, and easy to integrate into various applications.

What are lexical's main functionalities?

Basic Text Editing

This feature allows you to create a basic text editor instance and perform simple text editing operations such as appending text.

const { createEditor } = require('lexical');
const editor = createEditor();
editor.update(() => {
  const root = editor.getRoot();
  root.appendText('Hello, Lexical!');
});

Custom Plugins

Lexical supports custom plugins to extend the editor's functionality. This example demonstrates how to create a custom plugin that logs the editor state changes.

const { createEditor, LexicalComposer } = require('lexical');
const MyCustomPlugin = () => {
  return {
    onChange(editorState) {
      console.log('Editor state changed:', editorState);
    }
  };
};
const editor = createEditor({ plugins: [MyCustomPlugin] });

Rich Text Formatting

This feature allows you to apply rich text formatting such as bold, italic, and underline to the text within the editor.

const { createEditor, $createParagraphNode, $createTextNode } = require('lexical');
const editor = createEditor();
editor.update(() => {
  const root = editor.getRoot();
  const paragraph = $createParagraphNode();
  const text = $createTextNode('Bold Text');
  text.toggleFormat('bold');
  paragraph.append(text);
  root.append(paragraph);
});

Other packages similar to lexical

Keywords

FAQs

Package last updated on 29 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc