Releases: bramus/mermaid-element
Releases · bramus/mermaid-element
Release list
1.0.1
1.0.0
✨ First release!
- Declarative & Zero-Config: Place your Mermaid syntax directly inside the
<mermaid-element>custom element. - Dynamic Version Switching:
- Defaults to Mermaid 12 (loaded dynamically on-demand from
cdn.jsdelivr.net). - Pass a version string or number (e.g.
mermaid="10.9.8") to dynamically load that version on-demand fromcdn.jsdelivr.net. - Pass a URL (e.g.
mermaid="https://..."ormermaid="/js/...") to load Mermaid from a specific endpoint.
- Defaults to Mermaid 12 (loaded dynamically on-demand from
- Pre-Installed / Bundled Mermaid Support: Use your locally installed
mermaiddependency (npm install mermaid-element mermaid) by settingMermaidElement.defaultMermaid = mermaid, fully bypassing CDN requests for offline or self-contained builds. - Smart In-Memory Caching: Instances are cached by version and URL. Multiple
<mermaid-element>elements sharing the same version will only download and initialize Mermaid once. - Shadow DOM Encapsulation: Diagram SVGs are rendered cleanly in an open Shadow Root with customizable CSS
::part()hooks. - Flexible Syntax Formats: Supports direct text,
<template>(ideal for unescaped HTML characters),<code>, and<pre>blocks. - Reactive API: Updating child content, changing the
mermaidorthemeattributes, or modifying the.diagramproperty automatically re-renders the diagram. - Graceful Error Handling: Captures syntax errors, emits an
errorevent, and renders an accessible error alert withpart="error"without breaking the host page.
Check out the interactive showcase and live playground at https://mermaid-element.netlify.app/.