npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@domternal/vue

v1.1.0

Published

MIT-licensed Vue 3 components for the Domternal rich text editor

Downloads

1,561

Readme

@domternal/vue

Version MIT License

Vue 3 bindings for the Domternal editor. Provides the composable Domternal component with namespaced subcomponents, the useEditor and useEditorState composables for full control, provide/inject helpers for sharing one editor across descendants, and VueNodeViewRenderer for writing custom node views as Vue SFCs. SSR-safe by default: the editor is created in onMounted. Requires Vue 3.3+ and the Composition API.

Links

Website    •    Documentation    •    Live examples

Install

pnpm add @domternal/vue @domternal/core @domternal/theme vue

vue (>=3.3) and @domternal/core (>=1.1.0 <2.0.0) are peer dependencies. @domternal/theme supplies the editor styles.

Usage

Composable component pattern (recommended): Domternal creates the editor and provides it to all subcomponents via inject, so children need no editor prop.

<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>

Composable hook

Use useEditor directly when you need the editor instance, then read reactive state with useEditorState:

<script setup lang="ts">
import { useEditor, useEditorState, provideEditor, DomternalToolbar } from '@domternal/vue';
import { StarterKit } from '@domternal/core';

const { editor, editorRef } = useEditor({
  extensions: [StarterKit],
  content: '<p>Start typing...</p>',
  onUpdate: ({ editor }) => console.log(editor.getHTML()),
});

provideEditor(editor);

const { htmlContent, isEmpty } = useEditorState(editor);
</script>

<template>
  <DomternalToolbar />
  <div class="dm-editor">
    <div ref="editorRef" />
  </div>
</template>

useEditor returns editor (a ShallowRef<Editor | null>, null until mounted unless immediatelyRender is set) and editorRef (bind to the mount element). useEditorState returns htmlContent, jsonContent, isEmpty, isFocused, and isEditable, or pass a selector for a granular ComputedRef:

const isBold = useEditorState(editor, (ed) => ed.isActive('bold'));

Options

useEditor(options) takes:

| Option | Type | Default | Description | |---|---|---|---| | extensions | AnyExtension[] | [] | Extensions to load on top of DEFAULT_EXTENSIONS. | | history | boolean | true | Whether the built-in History extension is loaded. Turn it off when an extension brings its own undo. | | content | Content | '' | Initial content, HTML string or JSON. | | editable | boolean | true | Whether the editor is editable. | | preset | 'classic' \| 'notion' | 'classic' | 'notion' paints dm-notion-mode on the .dm-editor host and switches preset-aware extensions to their Notion behavior. Create-time only. | | autofocus | FocusPosition | false | Where to place the caret on mount. | | outputFormat | 'html' \| 'json' | 'html' | Format used when comparing incoming content against the document. | | immediatelyRender | boolean | false | Create the editor during setup instead of in onMounted. Not SSR-safe. |

onCreate, onUpdate, onSelectionChange, onFocus, onBlur, and onDestroy callbacks are accepted alongside them. <Domternal> and <DomternalEditor> take the same options as props, except history: their prop lists are fixed, so :history="false" never reaches the composable. Call useEditor({ history: false }) with provideEditor instead.

Exports

  • Composables: useEditor, useEditorState (full state or a granular selector), useCurrentEditor, provideEditor, useNotionColorPicker
  • Constants: DEFAULT_EXTENSIONS, EDITOR_KEY
  • Composable component: Domternal with Domternal.Toolbar, Domternal.Content, Domternal.BubbleMenu, Domternal.FloatingMenu, Domternal.EmojiPicker, Domternal.Loading
  • Components: DomternalEditor (supports v-model), EditorContent, DomternalToolbar, DomternalBubbleMenu, DomternalFloatingMenu, DomternalEmojiPicker, DomternalNotionColorPicker
  • Node views: VueNodeViewRenderer, NodeViewWrapper, NodeViewContent, useVueNodeView
  • Core re-exports: the Editor class plus the Content, AnyExtension, FocusPosition, and JSONContent types
  • SSR helpers (re-exported from core, work without an editor instance): generateHTML, generateJSON, generateText