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

vue3-markdown-kit

v0.1.0

Published

A small, auditable Markdown preview toolkit for Vue 3.5.

Readme

Vue 3 Markdown Kit

A small, auditable Markdown preview toolkit for Vue 3.5. It provides a component-friendly preview API, a framework-independent renderer, and GitHub-style presentation.

This package is the Vue 3 counterpart of vue-markdown-kit. It keeps the same preview props, events, themes, CSS, and import layout while using the Vue 3 application and rendering APIs.

Features

  • Vue 3.5 preview component built with the Composition API
  • Markdown rendering through markdown-it
  • HTML sanitization through DOMPurify
  • Opt-in, tree-shakeable highlight.js language registration
  • GitHub-style Markdown CSS
  • Image-click and rendered-content events
  • TypeScript declarations and ESM/CommonJS builds
  • Compatibility and modern package entry points

Requirements

  • Vue 3.5 or newer
  • Node.js 18 or newer for package tooling

Install

npm install vue3-markdown-kit

Recommended usage

Configure the theme once in your application entry point:

import { createApp } from 'vue'
import App from './App.vue'

import VueMarkdownKit, { VMdPreview, githubTheme } from 'vue3-markdown-kit'
import 'vue3-markdown-kit/style/preview.css'
import 'vue3-markdown-kit/theme/style/github.css'

VMdPreview.use(githubTheme)

createApp(App)
  .use(VueMarkdownKit)
  .mount('#app')

The plugin globally registers <v-md-preview>:

<script setup lang="ts">
import { ref } from 'vue'

const markdown = ref('# Hello, Vue 3')

function handleImageClick(images: string[], index: number) {
  console.log(images[index])
}
</script>

<template>
  <v-md-preview
    :text="markdown"
    @image-click="handleImageClick"
  />
</template>

For local registration, import the component directly:

<script setup lang="ts">
import { VMdPreview, githubTheme } from 'vue3-markdown-kit'
import 'vue3-markdown-kit/style/preview.css'
import 'vue3-markdown-kit/theme/style/github.css'

VMdPreview.use(githubTheme)

const markdown = '# Locally registered component'
</script>

<template>
  <VMdPreview :text="markdown" />
</template>

highlight.js

Register only the languages your application uses:

import { VMdPreview, githubTheme } from 'vue3-markdown-kit'
import hljs from 'highlight.js/lib/core'
import javascript from 'highlight.js/lib/languages/javascript'

hljs.registerLanguage('javascript', javascript)

VMdPreview.use(githubTheme, {
  Hljs: hljs,
})

Compatibility entry points

Integrations migrating from the Vue 2 package can retain the old import layout and change only the package name:

import VMdPreview from 'vue3-markdown-kit/lib/preview'
import 'vue3-markdown-kit/lib/style/preview.css'

import githubTheme from 'vue3-markdown-kit/lib/theme/github.js'
import 'vue3-markdown-kit/lib/theme/style/github.css'

VMdPreview.use(githubTheme)

Vue 3 uses createApp(...).use(...); replace any Vue 2 Vue.use(...), Vue.extend(...), $mount(), $on(), and $destroy() integration code with their Vue 3 equivalents.

Framework-independent renderer

The renderer and sanitizer can be used without mounting a Vue component:

import {
  createMarkdownRenderer,
  sanitizeHtml,
} from 'vue3-markdown-kit/core'

const parser = createMarkdownRenderer()
const safeHtml = sanitizeHtml(parser.render('# Hello'))

Preview props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | text | string | '' | Markdown source | | theme | object | undefined | Per-instance theme plugin or theme config | | tabSize | number | 2 | CSS tab size | | scrollContainer | function | () => window | Scroll target retained for API compatibility | | top | number | 0 | Scroll offset retained for API compatibility | | sanitizeOptions | object | {} | Additional DOMPurify options |

Events

  • change(text, html) fires after Markdown is rendered and sanitized.
  • image-click(images, index) fires when a rendered image is clicked.

Security

Raw HTML is enabled for compatibility, then sanitized as the final rendering step. Applications that do not need raw HTML can pass html: false when creating a custom renderer. Keep all runtime dependencies updated and apply an application-level Markdown input length limit.

Development

npm ci
npm test
npm run check

The generated lib directory is committed so the package can also be installed directly from GitHub.

License

MIT. See LICENSE and NOTICE.md.