@comark/vue
@comark/vue
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
.vuefile undersrc/components/prose(orcomponents/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
Nuxt module for Comark. Render Markdown with components at runtime, with auto-im...
Vue renderer for @xmachines/json-render-core. JSON becomes Vue components.
Vue 3 port of streamdown — a drop-in replacement for vue-markdown, designed for...
Vue 3 adapter for AIGUI — stream LLM output into live Vue components with cards...
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 | ||
| 0.6.0 | ^3.5.0 | ||
| 0.5.1 | ^3.5.0 | ||
| 0.5.0 | ^3.5.0 | ||
| 0.4.0 | ^3.5.0 | ||
| 0.3.1 | ^3.5.0 | ||
| 0.3.0 | ^3.5.0 | ||
| 0.2.1 | ^3.5.0 | ||
| 0.2.0 | ^3.5.0 | ||
| 0.1.1 | ^3.5.0 | ||
| 0.1.0 | ^3.5.0 |