@comark/vue

Vue 3 renderer for Comark. Render Markdown with components at runtime, with streaming support for AI output.
1,255,538 1,080
Install
npm install @comark/vue
Latest Version:0.8.1
Vue:3
Last Updated:Oct 27, 2026
Links: GitHub  ·  npm
Maintainer: farnabaz
Comark banner

@comark/vue

npm version npm downloads CI Documentation license

Vue renderer for Comark. Render markdown with custom Vue components, streaming support, and SSR.

Features

  • 🧩 <Markdown> component for one-shot markdown rendering
  • 🎯 Map any Comark tag to a custom Vue component
  • 🌊 Streaming-friendly with auto-close and caret support
  • 🖥️ SSR-safe, works in Nuxt and Vite
  • 🎨 Optional Vite plugin for compile-time component resolution
  • 🔌 Plugin ecosystem (math, mermaid, highlight, binding…)

Installation

npm install @comark/vue
# or
pnpm add @comark/vue

Usage

<script setup lang="ts">
import { Markdown } from '@comark/vue'
import math, { Math } from '@comark/vue/plugins/math'

const content = `# Hello\n\nThis is **Comark** in Vue.`
</script>

<template>
  <Markdown :components="{ math: Math }" :plugins="[math()]">
    {{ content }}
  </Markdown>
</template>

Custom components

<script setup lang="ts">
import { Markdown } from '@comark/vue'
import Alert from './components/Alert.vue'
</script>

<template>
  <Markdown :components="{ alert: Alert }">{{ content }}</Markdown>
</template>
::alert{type="warning"}
Heads up!
::

Streaming

<Markdown :streaming="isStreaming" caret>{{ content }}</Markdown>

Using with Vite

@comark/vue ships an optional Vite plugin that:

  • Enables <slot unwrap="..."> inside custom markdown components.
  • Auto-registers every .vue file under src/components/prose (or components/prose) as a global component.
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import comark from '@comark/vue/vite'

export default defineConfig({
  plugins: [vue(), comark()],
})

Pass comark({ prose: false }) to opt out of the auto-registered prose components.

Using with Nuxt

For Nuxt, use @comark/nuxt which auto-imports the <Markdown> component and wires up ~/components/prose overrides.

Documentation

Full guide and API reference at comark.dev/rendering/vue.

License

Made with ❤️

Published under MIT License.

Related Packages

@comark/nuxt

Nuxt module for Comark. Render Markdown with components at runtime, with auto-im...

390,704 1,080
@json-render/vue

Vue renderer for @json-render/core. JSON becomes Vue components.

433,381 18,809
@xmachines/json-render-vue

Vue renderer for @xmachines/json-render-core. JSON becomes Vue components.

9,327
vue3-streamdown

Vue 3 port of streamdown — a drop-in replacement for vue-markdown, designed for...

860
@ai-gui/vue

Vue 3 adapter for AIGUI — stream LLM output into live Vue components with cards...

11,789 0

Version History

Version Released Vue License
0.8.1 ^3.5.43
0.8.0 ^3.5.43
0.7.0 ^3.5.0
0.6.2 ^3.5.0
0.6.1 ^3.5.0