
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
lexical-react-editor
Advanced tools
This is a text editor library I made to support one of my projects
This is a text editor library I made to support one of my projects
It uses lexical library for rich text editing experience in the web https://lexical.dev/
A Example of how to use this library can be found in /website directory of this project and hosted in this link https://lexical-text-editor-2.netlify.app/
import {defaultEditorTheme, Editor, Bold, Italic, AddChecklist, AddIndent, AddUnorderedList} from "lexical-react-editor";
function App() {
return (
<>
<div >
<Editor>
<div className="yourToolbar">
// imported buttons to perform text editing
<Bold />
<Italic />
<AddChecklist />
<AddIndent />
<AddUnorderedList />
</div>
</Editor>
</div>
</>
)
}
Optionally you can pass a theme prop to customize Editor Styling
import {defaultEditorTheme, Editor, Toolbar, Bold, Italic, AddChecklist, AddIndent, AddUnorderedList} from "lexical-react-editor";
<Editor
theme={{
...defaultEditorTheme,
editorClassName: 'yourEditorClassName'
}}
>
<div className="yourToolbar">
// imported buttons to perform text editing
<Bold />
<Italic />
<AddChecklist />
<AddIndent />
<AddUnorderedList />
</div>
</Editor>
Other available properties in defaultEditorTheme are in below interface
interface IDefaultEditorTheme {
editorClassName: string;
placeholderClassName: string;
toolbarClassName?: string;
toolbarButton?: string;
toolbarButtonActive?: string;
defaultFont?: string;
dropdownButtonClassname?: string;
dropdownListClassname?: string;
dropdownItemClassname?: string;
}
Additionally you can make your own lexical nodes and pass it as a props to the editor To add this properly import lexicalComposerContext as below
Doc to how to add a node https://lexical.dev/docs/concepts/nodes
Doc to how to add a plugin https://lexical.dev/docs/react/create_plugin
import {useLexicalComposerContext} from "lexical-react-editor";
<Editor
theme={{
...defaultEditorTheme,
editorClassName: 'yourEditorClassName'
}}
nodes={[
customParagraphNode,
orderedListNode,
]}
>
</Editor>
FAQs
This is a text editor library I made to support one of my projects
We found that lexical-react-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.