npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

blocknote-mermaid

v1.0.1

Published

A powerful Mermaid diagram plugin for BlockNote editor. Create flowcharts, sequence diagrams, Gantt charts, and more.

Readme

BlockNote Mermaid

BlockNote Mermaid Banner

npm version License: MIT Stability Badge

A powerful Mermaid diagram plugin for BlockNote editor. Create beautiful flowcharts, sequence diagrams, Gantt charts, and more directly in your BlockNote editor.

Features

  • 📊 Multiple Diagram Types - Flowcharts, Sequence diagrams, Gantt charts, Class diagrams, State diagrams, ER diagrams, and more
  • 🎨 Live Preview - See your diagrams render in real-time as you type
  • 📝 Code Editor - Syntax-highlighted Mermaid code editor with CodeMirror
  • 📋 Built-in Templates - Quick-start templates for all diagram types
  • 🔍 Zoom & Pan - Interactive diagram viewing with zoom controls and panning
  • 📥 Export to SVG - Download your diagrams as SVG files
  • 🔒 Lock Mode - Lock diagrams to prevent accidental edits
  • 📁 Collapsible - Collapse diagrams to save space
  • 📱 Responsive - Adapts to container width automatically
  • 🎯 Full Screen - View diagrams in fullscreen mode

🚀 Installation

# Using npm
npm install blocknote-mermaid

# Using yarn
yarn add blocknote-mermaid

# Using pnpm
pnpm add blocknote-mermaid

Peer Dependencies

Make sure you have these peer dependencies installed:

npm install @blocknote/core @blocknote/react @blocknote/mantine react react-dom react-icons @uiw/react-codemirror

📖 Usage

Basic Setup

import { BlockNoteSchema, defaultBlockSpecs } from "@blocknote/core";
import { BlockNoteView } from "@blocknote/mantine";
import { useCreateBlockNote, SuggestionMenuController, getDefaultReactSlashMenuItems } from "@blocknote/react";
import { MermaidBlock, insertMermaid } from "blocknote-mermaid";

// Create schema with mermaid block
const schema = BlockNoteSchema.create({
  blockSpecs: {
    ...defaultBlockSpecs,
    mermaid: MermaidBlock,
  },
});

function Editor() {
  const editor = useCreateBlockNote({ schema });

  return (
    <BlockNoteView editor={editor} slashMenu={false}>
      <SuggestionMenuController
        triggerCharacter="/"
        getItems={async (query) =>
          filterSuggestionItems(
            [...getDefaultReactSlashMenuItems(editor), insertMermaid()],
            query
          )
        }
      />
    </BlockNoteView>
  );
}

Using the Mermaid Block

Once integrated, you can:

  1. Type /mermaid in the editor to insert a new Mermaid block
  2. Use the code editor to write your Mermaid diagram code
  3. Click on templates to quickly get started with different diagram types
  4. Use the toolbar to zoom, pan, download, or toggle fullscreen

Supported Diagram Types

  • Flowchart - Process flows, decision trees
  • Sequence Diagram - API calls, user interactions
  • Class Diagram - Object-oriented design
  • State Diagram - State machines
  • Entity Relationship - Database schemas
  • Gantt Chart - Project timelines
  • Pie Chart - Data distribution
  • Mind Map - Brainstorming
  • Git Graph - Branch visualizations
  • And more...

🎨 Example Diagrams

Flowchart

flowchart TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[Great!]
    B -->|No| D[Debug]
    D --> B

Sequence Diagram

sequenceDiagram
    participant User
    participant API
    participant Database
    
    User->>API: Request Data
    API->>Database: Query
    Database-->>API: Results
    API-->>User: Response

🔧 Configuration

The Mermaid block accepts the following props:

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | string | Default flowchart | The Mermaid diagram code | | title | string | "Untitled Diagram" | Title of the diagram | | collapsed | "true" \| "false" | "false" | Whether the block is collapsed | | locked | "true" \| "false" | "false" | Whether editing is locked |

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📬 Support

If you have any questions or issues, please open an issue on GitHub.


Made with ❤️ by Yash Gupta