A modern Next.js application that allows you to create and download Mermaid diagrams in PNG and JPEG formats.
- Live Preview: See your Mermaid diagrams rendered in real-time
- Multiple Formats: Download diagrams as PNG or JPEG
- Example Templates: Pre-built examples for different diagram types
- Responsive Design: Works on desktop and mobile devices
- Modern UI: Clean, intuitive interface with gradient backgrounds
- TypeScript Support: Full type safety and IntelliSense
- React Hooks: Modern React patterns with useState and useEffect
- SSR Compatible: Server-side rendering support with dynamic imports
- Node.js 18+
- npm or yarn
-
Install Dependencies:
npm install # or yarn install -
Run Development Server:
npm run dev # or yarn dev -
Open Application: Navigate to http://localhost:3000
- Enter Code: Type or paste your Mermaid diagram code in the left panel
- Select Format: Choose PNG or JPEG from the dropdown
- Render: Click "Render Diagram" or wait for auto-render (1 second delay)
- Download: Click "Download" to save your diagram
- Flowcharts: Process flows and decision trees
- Sequence Diagrams: Interaction between actors
- Gantt Charts: Project timelines and schedules
- Class Diagrams: Object-oriented relationships
- And more: Any valid Mermaid diagram syntax
The application includes example buttons for:
- Flowchart: Basic process flow
- Sequence: Actor interactions
- Gantt: Project timeline
- Class: Object relationships
- Next.js 14: Latest Next.js with App Router
- React 18: Modern React with hooks
- TypeScript: Full type safety
- Mermaid.js: For diagram rendering
- html2canvas: For image conversion
- Dynamic Imports: SSR-compatible library loading
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Lint code
npm run lintMermaid-Downloader/
├── app/
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main page component
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── next.config.js # Next.js configuration
└── README.md # This file
- Chrome (recommended)
- Firefox
- Safari
- Edge
- Use the example buttons to quickly try different diagram types
- The application auto-renders as you type (with a 1-second delay)
- Higher quality downloads are generated with 2x scaling
- All diagrams are rendered with a white background for clean downloads
- Libraries are dynamically imported to avoid SSR issues
Vibed up 👽