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

react-markdown-pro

v1.0.11

Published

An enhanced React markdown component with image, code, and LaTeX support.

Readme

react-markdown-pro

react-markdown-pro is an enhanced React component for rendering Markdown content with support for images, syntax-highlighted code blocks, and LaTeX math equations rendered via KaTeX. It is designed as an all-in-one solution for projects that require rich, interactive Markdown rendering.

Features

  • Rich Markdown Rendering:
    Supports standard Markdown syntax—including headings, lists, links, blockquotes, and more—with customizable styles.

  • GitHub Flavored Markdown:
    Enhanced support through remark-gfm, enabling tables, task lists, strikethrough, and other GFM features.

  • LaTeX Math Support:
    Render inline and block math expressions using KaTeX, making it easy to display complex mathematical notation.

  • Syntax Highlighting:
    Code blocks are beautifully rendered and syntax highlighted using react-syntax-highlighter, complete with line numbering and customizable themes.

  • Image Support:
    Automatically render images via Markdown with responsive styling, ensuring they display correctly on all devices.

  • Clipboard Integration:
    Built-in copy-to-clipboard functionality for code snippets, making it simple to copy and share code.

  • Raw HTML Support:
    Supports rendering of raw HTML within Markdown (with proper security considerations), allowing the integration of custom HTML elements.

  • Automatic Heading IDs:
    Generates unique IDs for headings (based on their line numbers), which aids in deep linking and navigation.

  • Inline Mode Rendering:
    Offers an inline mode via a dedicated prop, allowing Markdown content to be rendered within a single text flow.

  • Automatic Line Break Handling:
    Converts newline characters and <br> tags into proper line breaks, ensuring your content is displayed as intended.

  • Plugin Extensibility:
    Integrates with powerful remark and rehype plugins (such as remark-math, rehype-slug, and rehype-raw) to extend Markdown functionality and customize rendering behavior.

  • TypeScript Support:
    Built entirely in TypeScript with well-defined interfaces, ensuring better type safety and developer experience in modern React projects.

Installation

Install via npm:

npm install react-markdown-pro

How to Use

Using react-markdown-pro is straightforward:

import React from 'react';
import MarkdownPro from 'react-markdown-pro';

function Example() {
  // You can use simple string content
  const simpleExample = "# Hello World\n\nThis is **bold** text and *italic* text.";
  
  // Or more complex content with math equations
  const mathExample = "Solve for $x$: $2x + 3 = 7$.\n\nThe quadratic formula is: $$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$";

  return (
    <div className="container">
      <MarkdownPro>{simpleExample}</MarkdownPro>
      
      <h2>Math Example:</h2>
      <MarkdownPro>{mathExample}</MarkdownPro>
    </div>
  );
}

export default Example;

Real-world Example

Perfect for educational applications with math equations:

import React from 'react';
import MarkdownPro from 'react-markdown-pro';

const questions = [
  { id: 1, question: "Solve for $x$: $2x + 3 = 7$." },
  { id: 2, question: "Differentiate $f(x)=x^2 + 3x + 5$ with respect to $x$." },
  { id: 3, question: "Evaluate the integral $\\int_0^1 x^2\\, dx$." },
  { id: 4, question: "Express Ohm's law: $V = IR$" }
];

const QuestionList = () => {
  return (
    <div className="questions-container">
      <h1>Math Problems</h1>
      <ul>
        {questions.map((q) => (
          <li key={q.id}>
            <strong>Question {q.id}:</strong> <MarkdownPro>{q.question}</MarkdownPro>
          </li>
        ))}
      </ul>
    </div>
  );
};

export default QuestionList;

Example Screenshot

Alt Text