Typora Mermaid: Enable, Style and Export Diagrams
November 11, 2026 · 9 min read
Typora Mermaid: Enable, Draw and Export Diagrams
Typora Mermaid support turns a fenced code block tagged mermaid into a live diagram right inside the document. You switch on the Diagrams option in Preferences, type the fence, and Typora draws the chart when you leave the block. This guide covers setup, styling, export, and what to check when a diagram won't render.
How Do I Enable Mermaid Diagrams in Typora?
Diagrams are an optional Markdown extension in Typora. With the option off, your Mermaid code stays a plain code block. Typora's diagram documentation puts the switch in one place: the Markdown section of the Preferences panel.
- Open Typora's Preferences panel.
- Go to the Markdown section.
- Turn on the Diagrams option.
- Reload the window if Typora asks you to.
Older releases needed a full restart before changed Markdown settings took effect. The Typora 1.13 release notes say that's no longer the case: a tooltip and button now reload the window and apply the change.
Inserting a Typora Mermaid Block
Type three backticks followed by mermaid on an empty line and press Enter. Typora opens a code fence with the language already set. You can also use the Code Fences shortcut (Ctrl+Shift+K on Windows and Linux, Command+Option+C on macOS) and type mermaid into the language box.
Here's the smallest useful block:
```mermaid
flowchart TD
A[Draft] --> B[Review]
B --> C[Publish]
```
While your cursor is in the block, you see the code. Move the cursor out and Typora shows three boxes stacked top to bottom, joined by arrows, like this:
Click the diagram to get back to the source. One trap: Typora also renders a flow fence with flowchart.js and a sequence fence with js-sequence. Those are separate engines with their own syntax, not Mermaid. For the Mermaid syntax itself, our guide to Mermaid diagrams in Markdown covers flowcharts, sequence diagrams, Gantt charts, class diagrams and pie charts.
Typora Mermaid Versions and Diagram Types by Release
Each Typora release bundles its own copy of the Mermaid library, so the diagram types you can draw depend on your version. The Mermaid upgrades are listed in Typora's release notes, spread over several pages. We pulled the Mermaid lines into one table:
| Typora release | Notes published | Bundled Mermaid | Mermaid changes in the notes |
|---|---|---|---|
| 1.8 | January 19, 2024 | Not stated | XY chart, Mermaid's own dark theme in dark mode, copy as HTML |
| 1.9 | June 20, 2024 | 10.9 | Block diagram |
| 1.10 | February 15, 2025 | 11.4 | Packet, kanban and architecture diagrams |
| 1.11 | August 16, 2025 | 11.9 | Radar chart, treemap, fix for clipped text in PDF export |
| 1.12 | September 19, 2025 | Not stated | None listed |
| 1.13 | April 3, 2026 | 11.13.0 | Venn and Ishikawa diagrams, fix for exporting multiple diagrams |
| 1.14 | July 19, 2026 | Not stated | None listed |
The long-standing types (sequence, flowchart, Gantt, class, state, pie, requirement, gitgraph, C4, mindmap, timeline, quadrant, Sankey and ZenUML) are documented on Typora's diagram page. Typora warns that ZenUML isn't a first-class Mermaid diagram, so it may lack features such as dark themes.
Several newer types still use keywords like packet-beta, radar-beta and treemap-beta in Typora's own examples. Beta syntax can change between Mermaid releases, so copy examples that match your bundled version.
Styling Diagrams with Typora's Mermaid CSS Variables
Five CSS variables configure Mermaid in Typora. You add them as custom CSS, which Typora loads from a .user.css file in its theme folder (Preferences, Appearance, Open Theme Folder). The variables, as listed on Typora's Diagram Options page:
:root {
--mermaid-theme: forest; /* default, base, dark, forest, neutral or night */
--mermaid-font-family: "trebuchet ms", verdana, arial, sans-serif;
--mermaid-sequence-numbers: on; /* off by default */
--mermaid-flowchart-curve: basis; /* linear, basis, natural or step */
--mermaid--gantt-left-padding: 200; /* note the double hyphen; default 75 */
}
.md-diagram-panel-preview { text-align: left; } /* left-align diagrams */
With this file in place, every Mermaid diagram uses the forest palette with curved flowchart edges, and sequence diagrams number their messages. The --sequence-theme variable (simple or hand) only affects js-sequence blocks, not Mermaid. Our Typora themes guide explains how base.user.css and per-theme override files load.
For a single diagram, Typora also documents the %%{init: ...}%% directive on the first line of the block. Mermaid's own directives page marks directives as deprecated since v10.5.0 and points to a config key in frontmatter instead. Typora 1.11's notes list a fix for --- not rendering correctly in Mermaid, so use 1.11 or later for this form:
```mermaid
---
config:
theme: neutral
---
flowchart LR
A --> B
```
We prefer per-diagram config over the CSS variables when a file leaves your machine. The settings travel inside the code block, so other Mermaid renderers can apply them too, while the CSS variables only exist in Typora. Our guide to Mermaid JS themes covers the built-in themes and custom colours through themeVariables.
Exporting Typora Mermaid Diagrams to PDF, HTML and Word
Rendered diagrams go into your HTML, PDF, epub and docx exports. Other export formats don't include diagrams, according to Typora's docs. You can also right-click any diagram to save it as an SVG, PNG or JPG file, or to copy it to the clipboard.
Three export details catch people out:
- Theme mismatch. Export with a different theme from the one you're using, and some Mermaid options in that theme's CSS won't reach the HTML, PDF or image.
- Old bugs. Text clipped in PDF exports was fixed in 1.11, and exporting several diagrams at once was fixed in 1.13. Update before you debug your own file.
- Copying for the web. Since 1.8, you can copy a Mermaid diagram as HTML.
Typora's docs also point out that diagrams aren't part of standard Markdown, CommonMark or GFM. If the file must look right everywhere, export an image and embed that alongside the code. For more control over resolution, our Mermaid to PNG guide covers four export methods outside Typora.
Why Is My Mermaid Diagram Not Rendering in Typora?
When a block shows code or an error instead of a diagram, work through these checks in order:
- Diagrams is off. Check the Markdown section of Preferences, then reload the window.
- The fence is wrong. The language must be
mermaid. Azure DevOps wikis use a::: mermaidcontainer, which Typora doesn't recognise. The request for it was folded into a still-open index of extra syntax requests on Typora's issue tracker. - Your Typora is older than the syntax. Mermaid's docs follow the newest release, so a kanban or Venn example fails on a version that predates it. Compare your version with the table above.
- The code has an error. A missing arrow or an unclosed bracket stops the whole diagram. Paste the block into a browser previewer (see the next section) to find the line.
Two quirks show up as wrong output rather than no output. An open issue reports that flowchart-elk draws the same as a plain flowchart since Typora moved to Mermaid 11. The cause: Mermaid 11 no longer bundles the ELK layout engine. An older, closed report from Typora 0.9.98 described state and class diagrams rendering very small, and Typora's developer traced it to a change in Mermaid itself. If you see this, update Typora first.
Testing a Mermaid Block Outside Typora
The fence you write in Typora is ordinary Mermaid, so you can check it in a browser before opening the app. That's handy when a diagram fails and you want to know whether the code or Typora is at fault.
Our editor renders mermaid fences live in a split view (flowchart, sequence, class, state, gantt, pie and more). Edit the demo below:
There's a limitation: our preview doesn't read Typora's CSS variables, so a diagram styled with --mermaid-theme shows Mermaid's default look here. For a diagram-only workspace, the Mermaid editor adds templates, themes and PNG or SVG export. Our Markdown to PDF converter renders Mermaid into the PDF, and each export uses one of the 3 free server operations a day.
Mermaid in Typora: Quick Answers
Once Diagrams is on, Typora Mermaid blocks are just fenced code. The real work is matching your syntax to the bundled Mermaid version and knowing which settings survive export. Keep the version table handy when a diagram breaks. To check a block before you paste it into Typora, try it in the editor, or read our guide to WYSIWYG Markdown editors for more on inline rendering.