Skip to content

Marzipan

Pure TypeScript Markdown Editor

Framework-agnostic editor with overlay preview and zero runtime dependencies

Marzipan Logo
💻

Zero Dependencies

Pure TypeScript implementation with all markdown actions bundled internally. No external formatting libraries required.

Overlay Preview

Live markdown rendering directly over the textarea with pixel-perfect alignment. See your content formatted in real-time.

🎨

Beautiful Themes

Built-in Solar (light) and Cave (dark) themes with custom accent color support. Fully customizable styling.

🔧

Actions System

15+ formatting helpers for bold, italic, headers, lists, links, and more. Use them anywhere in your app.

🧩

Plugin Architecture

Tree-shakeable plugins for tables, Mermaid diagrams, syntax highlighting, image management, and custom extensions.

🚀

Framework Agnostic

Works seamlessly with React, Vue, Svelte, Angular, or vanilla JavaScript. No lock-in.

📱

Mobile Friendly

Responsive design with iOS zoom prevention, touch-optimized controls, and adaptive layouts.

⏱️

Smart Features

Auto-resize, smart lists, keyboard shortcuts, statistics panel, link tooltips, and active line highlighting.

📝

TypeScript First

Written in strict TypeScript with comprehensive type definitions. Full IDE autocomplete support.

Quick Start

bash
npm install @pinkpixel/marzipan
ts
import { Marzipan } from '@pinkpixel/marzipan';

const [editor] = new Marzipan('#my-editor', {
  toolbar: true,
  theme: 'cave',
  smartLists: true,
});

Live Preview Example

ts
new Marzipan('#preview-demo', {
  toolbar: {
    buttons: ['bold', 'italic', '|', 'plain', 'view']
  },
  theme: 'solar',
  colors: {
    toolbarActive: '#ffe066',
    cursor: '#ff8c00'
  },
  value: '# Overlay Preview\n\nTry toggling between the plain textarea and live preview modes.'
});

The plain shorthand instantly flips the preview overlay on and off, while view opens the dropdown for preview-only mode. Combine instance-level colors with global themes to brand the editor without restarting your app.

Why Marzipan?

🎯 Built for Performance

Marzipan is designed from the ground up for speed and efficiency:

  • Zero runtime dependencies - Only 1 package to install
  • Tree-shakeable exports - Import only what you need
  • Lightweight core - Minimal bundle size impact
  • Fast rendering - Optimized overlay preview system

👨‍💻 Developer Experience

Marzipan makes markdown editing a joy to implement:

  • Comprehensive API - Intuitive methods and clear documentation
  • Action helpers - Pre-built formatting functions ready to use
  • Plugin system - Extend functionality without touching core
  • TypeScript support - Full type safety and IntelliSense

🎨 User Experience

Your users will love the editing experience:

  • Real-time preview - See formatted markdown instantly
  • Visual alignment - Preview overlays directly on the textarea
  • Smart assistance - Auto-continuation for lists and more
  • Beautiful themes - Professional light and dark modes

What's in the Box?

🧁 Core Library

@pinkpixel/marzipan - The main editor with actions and themes

🔌 Plugins

@pinkpixel/marzipan/plugins/* - Optional enhancements:

  • Tables (basic, grid, generator)
  • Mermaid diagrams (ESM & CDN)
  • Syntax highlighting
  • Image management
  • Accent swatches
  • And more!

🥤 Demo App

Bakeshop Demo - Full React playground showcasing every feature with live examples

Community

Join the Marzipan community:

License

Marzipan is Apache 2.0 licensed.

Made with ❤️ by Pink Pixel

Released under the Apache 2.0 License