Eidos

Installation Notice

The installation may currently fail. We recommend copying the code below and creating the extension manually in Eidos.

mermaid render

By: Mayne

Install Latest (v0.0.1)

A simple mermaid rendering component for use in gallery cards

import { useEffect, useRef } from "react";
import mermaid from "mermaid";

export default function MermaidRenderer({ text = "" }) {
  const mermaidRef = useRef(null);

  useEffect(() => {
    if (!text.trim()) {
      return
    }
    mermaid.initialize({
      startOnLoad: false,
      theme: "default",
      securityLevel: "loose",
    });

    if (mermaidRef.current && text.trim()) {
      mermaidRef.current.innerHTML = text;
      mermaid.init(undefined, mermaidRef.current);
    }
  }, [text]);

  return (
    <div className="mermaid w-full h-full overflow-hidden" ref={mermaidRef}>
    </div>
  );
}

Information

Author
Mayne
Type
block
Latest Version
0.0.1
Last Updated
06/12/2025
Published
06/12/2025

Version History

  • v0.0.1 06/12/2025