A beautiful React + TypeScript application for creating and visualizing Mermaid diagrams with an interactive editor and real-time preview.
- Interactive Code Editor: Real-time editing of Mermaid diagram code
- Live Preview: Instant diagram rendering with error handling
- Template Library: Quick start with Flowchart, Sequence, Pie Chart, Gantt, and Class Diagram templates
- Zoom & Pan: Interactive diagram navigation with zoom controls
- Fullscreen Mode: Dedicated view for detailed diagram inspection
- Export Options: Copy code to clipboard and download diagrams as SVG
- Responsive Design: Works seamlessly on desktop and mobile devices
- Touch Support: Pan and pinch-to-zoom for mobile devices
- Node.js 22 (see
.nvmrc) - yarn
- Clone the repository:
git clone https://github.com/sravanth-space/mermaid.git
cd mermaid- Install dependencies:
yarn install- Start the development server:
yarn dev- Open your browser and navigate to
http://localhost:5173
yarn buildThis type-checks the project (tsc -b) and then creates a dist folder with
the built application ready for deployment.
yarn typecheck
yarn lintThe application is automatically deployed to GitHub Pages at mermaid.sravanth.co.uk when changes are pushed to the main branch. The deployment workflow:
- Builds the React application using Vite
- Deploys the static files to GitHub Pages
- Uses the custom domain configured in the CNAME file
yarn preview- Edit Code: Use the left panel to write or edit Mermaid diagram code
- Quick Start: Click any template button to load pre-built diagram examples
- Navigate: Use zoom controls to zoom in/out, reset view, or go fullscreen
- Export: Copy the code or download the diagram as SVG
- Mobile: Use touch gestures to pan and pinch-to-zoom on mobile devices
- React 19: Modern React with hooks
- TypeScript: Type-safe components in strict mode
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- Lucide React: Beautiful icon library
- Mermaid.js: Diagram generation library
- Flowcharts
- Sequence diagrams
- Pie charts
- Gantt charts
- Class diagrams
- And many more Mermaid diagram types
This project is licensed under the MIT License - see the LICENSE file for details.
