@domternal/vue
| Install | |
|---|---|
npm install @domternal/vue |
|
| Latest Version: | 1.8.0 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 20, 2026 |
| Links: | GitHub · npm |
@domternal/vue
Vue 3 components and composables for the Domternal rich
text editor. Includes toolbar and menu components, v-model support, reactive
editor state, and custom node views written as Vue components.
Install
pnpm add @domternal/vue @domternal/core @domternal/theme vue
The package declares Node.js 22 or later for tooling. Requires Vue 3.3 or later and @domternal/core >=1.8.0 <2.0.0.
Use version 1.8.0 for all installed Domternal Free packages. Import the theme once in
your application for default styling.
Quick start
Use the composable component to arrange the toolbar, content, and menus:
<script setup lang="ts">
import { Domternal } from '@domternal/vue';
import { StarterKit, BubbleMenu } from '@domternal/core';
import '@domternal/theme';
const extensions = [StarterKit, BubbleMenu];
</script>
<template>
<Domternal :extensions="extensions" content="<p>Hello from Vue!</p>">
<Domternal.Toolbar />
<Domternal.Content />
<Domternal.BubbleMenu :contexts="{ text: ['bold', 'italic', 'underline'] }" />
</Domternal>
</template>
Domternal creates the editor, provides it to descendants, and destroys it on
unmount. The toolbar renders controls contributed by the loaded extensions.
Bind content with v-model
Use DomternalEditor when the document should bind to application state:
<script setup lang="ts">
import { ref } from 'vue';
import { DomternalEditor } from '@domternal/vue';
import { StarterKit, type Content } from '@domternal/core';
const extensions = [StarterKit];
const content = ref<Content>('<p>Start typing...</p>');
</script>
<template>
<DomternalEditor v-model="content" :extensions="extensions" />
</template>
The model holds HTML by default. Set outputFormat="json" and initialize it with
JSON content to bind JSON instead.
For full control, useEditor returns editor, a ShallowRef<Editor | null>, and
editorRef, which you bind to the mount element. Use provideEditor(editor) to
share it and useEditorState(editor, ed => ed.isActive('bold')) for derived state.
See the composable example.
Configuration notes
- The wrapper includes
Document,Paragraph,Text,BaseKeymap, andHistory.StarterKitadds common formatting. DomternalandDomternalEditordo not forward ahistoryprop. To use another undo manager, calluseEditor({ history: false, extensions })and omit History from those extensions as well. See disabling history.- Creation happens in
onMounted, so the editor isnullduring SSR and initial setup. LeaveimmediatelyRenderoff for SSR; see Nuxt integration. editablecontrols read-only mode.preset="notion"is read at creation. Replacei18nto update UI translations without recreating the editor.onContentErrorreports invalid initial content;onContentDiagnosticreports normalized content values. The Vue guide documents callback options; the Editor API explains diagnostics.- Custom
iconscontain raw SVG. Supply trusted, developer-authored constants.
Office paste and custom list labels
Register PasteCleanup in your editor's
extensions to normalize supported Word and Google Docs clipboard HTML. It is
not enabled by the wrapper. In 1.5.0, formattingForPaste lets your application
choose Preserve or Adapt for each paste without recreating the editor.
Add the corresponding formatting, Table and Image extensions for content you
want to retain. Use ListLabels for
supported custom markers, with the same schema on every collaborative writer.
Further reading
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.8.0 | MIT | |
| 1.7.0 | MIT | |
| 1.6.0 | MIT | |
| 1.5.1 | MIT | |
| 1.5.0 | MIT | |
| 1.4.0 | MIT | |
| 1.3.1 | MIT | |
| 1.3.0 | MIT | |
| 1.2.0 | MIT | |
| 1.1.1 | MIT | |
| 1.1.0 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT | |
| 0.15.0 | MIT | |
| 0.14.0 | MIT | |
| 0.13.0 | MIT | |
| 0.12.1 | MIT | |
| 0.12.0 | MIT | |
| 0.11.2 | MIT | |
| 0.11.1 | MIT | |
| 0.11.0 | MIT | |
| 0.10.0 | MIT | |
| 0.9.1 | MIT | |
| 0.9.0 | MIT | |
| 0.8.0 | MIT | |
| 0.7.5 | MIT | |
| 0.7.4 | MIT | |
| 0.7.3 | MIT |
Showing the latest 30 of 36. See every release on npm