Learn quikdown by building, one example at a time.
Four tracks. Sixteen examples. From a 10-line "render markdown to HTML" snippet to a fully headless editor wired to your own app shell. Work top-to-bottom or jump in anywhere.
Parser — quikdown core
9.8 KB · zero deps · XSS-safeStart here if you only need to render markdown to HTML — chat messages, blog posts, README previews, LLM output. The parser is the smallest layer of the stack: a single function that takes a markdown string and returns safe HTML. These four examples walk you from a five-line "hello world" to a custom fence plugin and runtime themes.
Hello world
The bare minimum: import quikdown, render a markdown string into a div. One script tag, one function call.
Example 2Parser options
Toggle inline_styles, lazy_linefeeds, bidirectional, allow_unsafe_urls live.
Custom fence plugin
Implement fence_plugin to render a custom fence type. Shows the signature and how to fall through.
Themes & emitStyles
Use quikdown.emitStyles() to generate CSS for light and dark themes. Classes vs inline styles.
Bidirectional — quikdown_bd
14.6 KB · HTML ↔ Markdown
Move up a layer when you need to go both directions: render markdown to HTML, let the user edit the HTML in a contenteditable region, then convert it back to markdown. quikdown_bd annotates the HTML with data-qd-* attributes so the round trip preserves formatting, fences, and tables. This is the engine behind quikdown_edit — and you can build your own editor on top of it.
Round-trip basics
Markdown → HTML → edit in contenteditable → toMarkdown(). Three side-by-side panes.
Reverse fence handlers
Fence plugin with both render and reverse for round-trip preserving custom fences.
Tables & fences round-trip
A pre-built document with table, code, lists. Edit; reverse-convert; verify the source rebuilds.
Editor — quikdown_edit
84.3 KB · drop-in or headless
The full markdown editor as a drop-in component. Live preview, contenteditable bidirectional editing, fence plugins for code, SVG, Mermaid, MathJax, CSV/TSV/PSV, GeoJSON, and STL. Toolbar, themes, undo/redo, keyboard shortcuts. Or run it headless with showToolbar: false and wire your own UI to the public API. The API playground example proves every public method is callable from code — the toolbar is just sugar.
Five-line embed
The minimal drop-in: import the editor, give it a div, you're done. No build setup.
Example 9Headless mode ★ killer
showToolbar: false. Custom UI wired to public API methods. The way to integrate the editor into your app shell.
API playground ★ showcase
Every public API method as a button with live console log. Proves the editor is fully drivable from code.
Example 11Custom fences in editor
Add a custom fence type via customFences. Example: a chart fence that renders a styled bar chart.
Runtime theme switching
setTheme('dark') at runtime. Honors system preference in auto mode.
Integrations — real-world use
how it fits in your stackHow quikdown plays with other tools. Real-world patterns: rendering markdown inside an LLM chat widget, streaming markdown chunks token-by-token from an LLM API, and wrapping the editor in a React or Vue component. The chat and streaming examples are interactive — the React and Vue ones are documented patterns ready to copy into your project.
quikchat — markdown in LLM chats
How quikchat uses quikdown to render fenced markdown in chat bubbles. Themable, lightweight. Includes a live simulated-chat demo.
Example 16Streaming LLM output
Render markdown chunks as they arrive from an LLM. Re-parse the buffer on every chunk — fast enough you can't see it. Live simulated stream.
Example 14React integration
Wrap QuikdownEditor in a React component. Both the parser-only and full-editor patterns.
Example 15Vue integration
Same patterns in Vue 3 idiom: v-html, ref, onMounted.
Standalone — offline editor
zero network dependenciesA single-file editor bundle (~3.8 MB minified) with all fence renderers built in: highlight.js, Mermaid diagrams, DOMPurify HTML sanitization, Leaflet GeoJSON maps, and Three.js STL 3D rendering. No CDN requests, no lazy loading — works fully offline and in air-gapped environments.
Try the offline editor
The full editor with all fence types pre-loaded. Syntax highlighting, Mermaid diagrams, SVG, CSV tables, JSON, and HTML fences — all rendering instantly with no network delay.
DocsStandalone documentation
Bundle contents, file sizes, usage patterns (ESM and UMD), build instructions, and when to use standalone vs. the regular lazy-loading editor.