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

react-inline-markdown-editor

v2.1.0

Published

A React markdown editor with live preview, built on CodeMirror 6 — syntax markers reveal only on the active line.

Readme

react-inline-markdown-editor

A React markdown editor with live preview, built on CodeMirror 6. Syntax markers (**, #, `) stay hidden while you read and reveal only on the line your cursor is on — so the document looks rendered, but every character is still directly editable.

react-inline-markdown-editor

Features

  • Live preview — headings, bold, italic, ~~strikethrough~~, inline code, links, images, blockquotes, lists and fenced code render in place
  • Syntax markers reveal on the active line and hide everywhere else
  • Bullet lists render with a marker
  • Dark and light themes, swappable at runtime without remounting
  • GitHub Flavored Markdown
  • Controlled component — you own the markdown string
  • CodeMirror is a peer-installed dependency, not bundled (keeps your build lean)

Install

npm i react-inline-markdown-editor

Peer deps: react and react-dom (>= 18). CodeMirror 6 packages install automatically.

Quick start

import React from "react";
import { InlineMarkdownEditor } from "react-inline-markdown-editor";

export default function App() {
  const [value, setValue] = React.useState(`# Heading\n\nSome **bold** text.\n\n- a list item`);

  return (
    <InlineMarkdownEditor
      value={value}
      onChange={setValue}
      theme="dark"
      height="400px"
    />
  );
}

Props

export type InlineMarkdownEditorProps = {
  /** Controlled markdown content. */
  value: string;
  /** Called on every change with the full new markdown string. */
  onChange: (next: string) => void;
  /** Visual theme. Defaults to "dark". */
  theme?: "dark" | "light";
  /** Class applied to the outer container div. */
  className?: string;
  /** Inline styles for the outer container div. */
  style?: React.CSSProperties;
  /** Editor height. Defaults to "100%". Accepts any CSS length. */
  height?: string;
};

Keyboard behavior

Standard CodeMirror editing keymaps: arrow-key navigation, undo/redo, Tab to indent, and the usual text-editing shortcuts.

Theming

theme switches between bundled dark and light palettes. Changing the prop at runtime swaps the theme via a CodeMirror compartment — no remount, no loss of focus or content. Wire it to your app's theme however you like:

<InlineMarkdownEditor value={value} onChange={setValue} theme={isDark ? "dark" : "light"} />

Security

The editor renders text as text — markdown is never converted to HTML and never injected into the DOM. Pasting <script> or any HTML shows it as literal characters. To display the markdown elsewhere, render it yourself with a sanitizing pipeline (e.g. marked + DOMPurify).

Build & publish (maintainers)

npm run build
npm publish --access public

License

MIT