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

nested-markdown

v0.0.14

Published

React renderer for extended markdown with inline nested markdown blocks.

Readme

nested-markdown

React renderer for extended markdown with inline nested markdown blocks.

Demo

Try out the live demo.

Install

npm i nested-markdown

or

yarn add nested-markdown

Peer dependencies:

  • react / react-dom (>= 17)

Quick Start

import NestedMarkdown from "nested-markdown";

const content = [
  "This is normal markdown.",
  "",
  '```nested-md emoji="💡" show="both" bgColor="#F8FFEE" textColor="#0F172A" borderColor="#A5D6A7"',
  "# Nested content",
  "",
  "- Supports GFM (tables, lists, etc.)",
  "- Can show preview and/or the original code",
  "```",
  "",
].join("\n");

export default function App() {
  return <NestedMarkdown content={content} theme="auto" />;
}

Component API

  • NestedMarkdown
    • content?: string — Markdown source (alias: children?: string)
    • className?: string — Class for outer container
    • components?: Componentsreact-markdown overrides merged with defaults
    • style?: React.CSSProperties — Inline styles for the outer container
    • theme?: "light" | "dark" | "auto" — Color theme (default "auto")
    • Also accepts most react-markdown props (e.g. remarkPlugins, rehypePlugins, allowedElements, skipHtml)
  • expandNestedMarkdown(markdown: string): Promise<string> — Preprocesses nested blocks into safe HTML

Nested Block Syntax

For a comprehensive guide on syntax, attributes, and examples, please refer to the User Manual.

Preferred (fenced) syntax:

```nested-md key="value" ...
...raw markdown body...
```

Legacy (HTML comment) syntax:

  • Start: <!-- nested-md:start key="value" ... -->
  • Body: raw markdown body or an inner raw markdown body fenced ```md ... ```
  • End: <!-- nested-md:end -->

Attributes

  • id?: string — Copied to data-id on wrapper
  • show?: "preview" | "code" | "both" — Display mode
  • bgColor?: string, textColor?: string, borderColor?: string — Colors
  • emoji?: string — Emoji/icon column
  • boxed?: "true" | "false" — Boxed UI (default true)
  • style?: string — Extra inline styles for wrapper

Styling Defaults

  • Tables are wrapped with horizontal scroll and basic table styles
  • Images render with a normal <img> and normalize relative src paths
  • Inline code and mark have gentle defaults
  • Automatic Dark Mode: Custom colors (bg/text/border) are automatically adjusted for dark mode, so you don't need to specify separate dark theme colors.

Security

  • rehype-raw is enabled to render the preprocessed HTML
  • Strict rehype-sanitize schema allows only needed tags/attributes including div[data-nested-md]

SSR

  • Designed to work with SSR setups; ensure peer deps (react) are present in the host app

License

  • MIT