The Markdown parser and renderer for everything.

Open-source Markdown parser and renderer with components, attributes and plugins. Streams AI output to React, Vue, Svelte, Angular, HTML and the terminal.
## Hello World

A JavaScript library to **parse and render Markdown** anywhere.

```ts
import { parseMarkdown } from 'comark'

const doc = await parseMarkdown('# Hello **World**')
```

## Features

- CommonMark and GFM support
- HTML, ANSI, and framework renderers
- Streaming, components, and plugins

::callout{icon="i-lucide-info"}
Built on markdown-exit, a TypeScript rewrite of markdown-it.
::

// Renderers //

Parse once, render anywhere

Comark parses Markdown into a compact MarkdownDocument. Parse on the server, during a build, or as content streams in, then render it natively in your framework. Your content outlasts your stack.

HTML
A plain string renderer for static site generators, RSS feeds or emails. No framework required.
ANSI
Render Markdown as styled terminal output using ANSI escape codes, perfect for CLIs, scripts, and developer tooling.
Angular
Standalone components for Angular 17+, with the same props and streaming support.
React
The same component API for React, including React Server Components and Next.js.
Vue
Drop the Markdown component in a template. Custom components and plugins are props.
Svelte
Native Svelte 5 rendering with runes. No wrapper framework, no {@html}.

// Streaming //

Built for AI output

A model streams Markdown a few characters at a time. Render it as it lands and your users watch raw asterisks appear, code fences hang open, and the layout jump on every token. Comark closes what is still open, so every frame renders as finished markup.

// Plugins //

Use official plugins, or write your own

Official plugins add syntax highlighting, math, diagrams, table of contents, and more. Write your own against the plugin API or browse all plugins.

highlight.ts
import { parseMarkdown } from 'comark'
import shiki from 'comark/plugins/shiki'
import githubDark from '@shikijs/themes/github-dark'
import githubLight from '@shikijs/themes/github-light'

const document = await parseMarkdown(content, {
  plugins: [
    shiki({
      themes: { light: githubLight, dark: githubDark }
    })
  ]
})

// Syntax //

Components in Markdown

Discover our opt-in syntax for components, attributes, and frontmatter, handled by default plugins you can turn off. CommonMark and GFM are supported by default, so the Markdown files you already have keep working.

components.md
::alert{type="info"}
This is an **important** message.
::

::card{title="My Card"}
Card content with full **markdown** support.
::

Click the :button[Submit]{type="primary"} to continue.

// FAQ //

Common questions

From Markdown to UI.

Install Comark, pick a renderer, and render your first Markdown document in minutes. Read why Comark exists, or start with the document model.
© 2026 Vercel, Inc.