Skip to content

Releases: bramus/mermaid-element

Release list

1.0.1

Choose a tag to compare

@bramus bramus released this 11 Sep 08:11

Internal cleanup. No changes or new features.

Check out the interactive showcase and live playground at https://mermaid-element.netlify.app/.

1.0.0

Choose a tag to compare

@bramus bramus released this 11 Sep 08:10

✨ 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 from cdn.jsdelivr.net.
    • Pass a URL (e.g. mermaid="https://..." or mermaid="/js/...") to load Mermaid from a specific endpoint.
  • Pre-Installed / Bundled Mermaid Support: Use your locally installed mermaid dependency (npm install mermaid-element mermaid) by setting MermaidElement.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 mermaid or theme attributes, or modifying the .diagram property automatically re-renders the diagram.
  • Graceful Error Handling: Captures syntax errors, emits an error event, and renders an accessible error alert with part="error" without breaking the host page.

Check out the interactive showcase and live playground at https://mermaid-element.netlify.app/.