lexical-vue

An extensible Vue 3 web text-editor based on Lexical.
166,694 362
Install
npm install lexical-vue
Latest Version:0.18.0
Vue:3
License:MIT
Last Updated:Oct 16, 2026
Links: GitHub  ·  npm
Maintainer: wobsoriano

Lexical Vue

An extensible Vue 3 web text-editor based on Lexical.

For documentation and more information about Lexical, be sure to visit the Lexical website.

Here are some examples of what you can do with Lexical:

Getting started with Vue

Requires Vue >= 3.5.0.

Install lexical-vue:

npm install lexical-vue # or pnpm or yarn

Below is an example of a basic plain text editor using lexical and lexical-vue.

<script setup lang="ts">
import { $getRoot, $getSelection } from 'lexical'

import { LexicalComposer } from 'lexical-vue/LexicalComposer'
import { AutoFocusPlugin } from 'lexical-vue/LexicalAutoFocusPlugin'
import { ContentEditable } from 'lexical-vue/LexicalContentEditable'
import { HistoryPlugin } from 'lexical-vue/LexicalHistoryPlugin'
import { OnChangePlugin } from 'lexical-vue/LexicalOnChangePlugin'
import { PlainTextPlugin } from 'lexical-vue/LexicalPlainTextPlugin'

const config = {
  editable: true,
  theme: {
    // Theme styling goes here
  },
}

// When the editor changes, you can get notified via the
// LexicalOnChangePlugin!
function onChange(editorState) {
  editorState.read(() => {
    // Read the contents of the EditorState here.
    const root = $getRoot()
    const selection = $getSelection()

    console.log(root, selection)
  })
}
</script>

<template>
  <LexicalComposer :initial-config="config">
    <PlainTextPlugin>
      <template #contentEditable>
        <ContentEditable>
          <template #placeholder>
            <div>Enter some text...</div>
          </template>
        </ContentEditable>
      </template>
    </PlainTextPlugin>
    <OnChangePlugin @change="onChange" />
    <HistoryPlugin />
    <AutoFocusPlugin />
  </LexicalComposer>
</template>

For a more complex example, check the rich text editor playground.

Creating custom Lexical nodes with Vue

Documentation

https://lexical-vue.vercel.app

Credits

License

MIT

Related Packages

@gridigor/vue-lexical

Vue 3 bindings for the Lexical editor framework

3,797 1
unilexical

Framework-agnostic, Notion-style block rich-text editor powered by Lexical

1,159 0
@juit/vue-tiny-editor

Juit Tiny Editor (for mentions!)

8,299 2
@matrajs/vue

Vue 3 bindings for Matra — useEditor, useEditorState, useEditorFocus and EditorC...

3,724 0
@mteditor/vue3

MtEditor 的 Vue 3 适配层:只做挂载、props 映射与事件透传的薄壳

996

Version History

Version Released License
0.18.0 MIT
0.17.0 MIT
0.16.0 MIT
0.15.1 MIT
0.15.0 MIT
Pre-releases (27)
Version Released License
0.1.0-beta.9 MIT
0.1.0-beta.8 MIT
0.1.0-beta.7 MIT
0.1.0-beta.6 MIT
0.1.0-beta.5 MIT