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 🙏

© 2025 – Pkg Stats / Ryan Hefner

markdown-editor-ubb

v1.1.1

Published

A **lightweight, split‑pane Markdown IDE** with live preview, rich toolbar, dark/light themes, resizable panes, full‑screen, undo/redo history, HTML & PDF export, and first‑class TypeScript support.

Readme

📘 MarkdownEditor (React 19 Component)

A lightweight, split‑pane Markdown IDE with live preview, rich toolbar, dark/light themes, resizable panes, full‑screen, undo/redo history, HTML & PDF export, and first‑class TypeScript support.


✨ Features

  • 📝 Live Preview – instant Markdown‑to‑HTML rendering with scroll‑sync.
  • 🌗 Dark / Light Toggle – built‑in button or controlled via prop.
  • 🎚️ Resizable Split Panes – drag or keyboard resize (10–90 %).
  • 🖥️ Full‑Screen Mode – native browser or in‑page overlay.
  • 🛠️ Rich Toolbar & Hot‑Keys – bold, italic, heading, code, quote, list, table, link, image, Undo / Redo.
  • ♻️ History Stack – granular undo/redo with configurable depth.
  • 📤 Export – one‑click download as static HTML or PDF.
  • 🔀 Partial Views – editor‑only, preview‑only, or both.
  • 🔒 Read‑Only Mode – lock editing while keeping live preview.
  • 🎨 Custom Styling – override CSS variables or pass classNames.
  • ⚛️ Built with React 19 + TypeScript – zero CSS framework (≤ 3 kB gzip).

📦 Installation

npm install markdown-editor-ubb marked
# or
pnpm add markdown-editor-ubb marked

Peer dependencies: react@^19, react-dom@^19


🚀 Usage Examples

1. Full‑featured editor

import { useState } from "react";
import MarkdownEditor from "markdown-editor-ubb";

export default function KnowledgeBaseArticle() {
  const [markdown, setMarkdown] = useState<string>(
    `# Release notes

- Added **full‑screen** mode
- Improved dark‑mode colours`
  );

  return (
    <MarkdownEditor
      /* core control */
      value={markdown}
      onChange={setMarkdown}
      /* appearance */
      theme="dark"
      height="75vh"
      showToggle
      /* editing UX */
      showToolbar
      showUndoRedo
      resizablePanes
      initialPaneRatio={0.4} // 40 % editor / 60 % preview
      /* export & utility */
      showExportHTML
      showExportPDF
      showFullscreen
      fullscreenMode="browser" // or "system"
      /* custom styling */
      editorClassName="kb-editor"
      previewClassName="kb-preview"
      style={{ border: "2px solid var(--mde-accent)", borderRadius: 8 }}
    />
  );
}

2. Preview‑only embed

<MarkdownEditor hideEditor defaultText={markdown} readOnly />

⚙️ Props

| Prop | Type | Default | Description | | ------------------ | ------------------------ | --------- | ------------------------------------- | | value | string | — | Controlled Markdown content. | | defaultText | string | '' | Initial content in uncontrolled mode. | | onChange | (text: string) => void | — | Fires after each edit batch. | | theme | 'light' \| 'dark' | 'light' | Initial colour scheme. | | showToggle | boolean | true | Show dark/light toggle. | | height | string | '80vh' | Total component height. | | readOnly | boolean | false | Disable editing. | | hideEditor | boolean | false | Hide the editor pane. | | hidePreview | boolean | false | Hide the preview pane. | | resizablePanes | boolean | true | Enable gutter drag & keyboard resize. | | showToolbar | boolean | true | Render formatting toolbar. | | showUndoRedo | boolean | true | Show undo/redo buttons & hot‑keys. | | showFullscreen | boolean | true | Show full‑screen toggle. | | showExportHTML | boolean | false | Show Export HTML button. | | editorClassName | string | '' | Class for <textarea>. | | previewClassName | string | '' | Class for preview pane. | | style | CSSProperties | {} | Inline styles for root container. |


🛠️ Development & Contribution

npm install
npm run dev

Start editing MarkdownEditor.tsx in src/components/.


📁 Project Structure

markdown-editor-ubb/
├─ src/
│  ├─ MarkdownEditor.tsx
│  ├─ markdownEditor.css
├─ example/          # Vite demo app
├─ dist/             # build output
├─ vitest.config.ts
├─ tsconfig.json
└─ README.md

🧪 Technologies Used

  • React 19
  • TypeScript
  • Vite
  • marked

🎓 Author

Malancioiu Daniel ‑ George Framework Design – Master’s Coursework