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-remarkify

v0.8.4

Published

A simple React.js utility to convert Markdown into React components.

Readme

react-remarkify

A lightweight React.js utility to transform Markdown into React.js components seamlessly.

Features

  • Effortlessly converts Markdown into React.js components.
  • Simple and user-friendly API.
  • Fully customizable.
  • Supports plugins for enhanced functionality.
  • Accepts flexible content via ReactNode, including Markdown strings or JSX.

Installation

Install react-remarkify using your preferred package manager:

# Using npm:
npm install react-remarkify --save

# Using Yarn:
yarn add react-remarkify

# Using pnpm:
pnpm add react-remarkify

# Using Bun:
bun add react-remarkify

Usage

react-remarkify provides two primary methods to incorporate Markdown into your React.js applications: the useRemark hook and the <Remark> component.

useRemark Hook

Use the useRemark hook to transform Markdown content into React.js components dynamically:

import React from "react";
import { useRemark } from "react-remarkify";

export default function App() {
  const heading = "# Welcome to the App";
  const description = "This is a **React-powered** Markdown block.";
  const markdown = useMemo(() => {
    return (
      <section>
        <div>{heading}</div>
        <div>{description}</div>
        <div>_This content is rendered from JSX and Markdown combined._</div>
      </section>
    );
  }, [heading, description]);

  const reactContent = useRemark({
    markdown,
    stableMarkdown: true,
    components: {
      h1: "h2",
      strong: (props) => <strong style={{ color: "#e67e22" }} {...props} />,
      em: (props) => <em style={{ fontStyle: "italic", opacity: 0.8 }} {...props} />,
    },
  });

  return reactContent;
}

Remark Component

Use the <Remark> component for a declarative approach:

import React from "react";
import Remark from "react-remarkify";

export default function App() {
  const heading = "# Welcome to the App";
  const description = "This is a **React-powered** Markdown block.";

  return (
    <Remark
      components={{
        h1: "h2",
        strong: (props) => <strong style={{ color: "#e67e22" }} {...props} />,
        em: (props) => <em style={{ fontStyle: "italic", opacity: 0.8 }} {...props} />,
      }}
    >
      <section>
        <div>{heading}</div>
        <div>{description}</div>
        <div>_This content is rendered from JSX and Markdown combined._</div>
      </section>
    </Remark>
  );
}

API Reference

useRemark Hook

The useRemark hook accepts the following parameters:

| Parameter | Type | Required | Default | Description | | ----------------------- | --------------------------------------------- | -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | markdown | React.ReactNode | Yes | - | The markdown content to be converted into React.js components. | | stableMarkdown | boolean | No | false | Skips expensive internal content analysis and relies on the referential identity of markdown. Enable this only if the provided markdown value is stable across renders, for example memoized with useMemo. If the reference changes, the content will be reprocessed. | | rehypePlugins | PluggableList | No | - | Plugins for rehype to extend functionality. | | rehypeReactOptions | RehypeReactOptions | No | - | Options for customizing the generated React.js components. | | remarkParseOptions | RemarkParseOptions | No | - | Parsing options for remark. | | remarkPlugins | PluggableList | No | - | Plugins for remark to enhance Markdown processing. | | remarkToRehypeOptions | RemarkRehypeOptions | No | - | Options for the remark to rehype transformation. | | components | Components | No | - | A mapping of HTML elements to custom React components, allowing customization of rendered Markdown elements. | | updateMode | UpdateMode | No | immediate | Controls how text changes are processed: immediate (updates instantly), throttle (updates at most every updateDelay ms, ideal for AI streaming), or debounce (waits updateDelay ms after changes stop, ideal for user typing). | | updateDelay | number (ms) | No | 0 | Delay for updateMode = throttle or debounce. Has no effect when updateMode is immediate. | | onError | Function | No | console.error | Callback to handle errors during the Markdown-to-React conversion process. |

Note: For performance reasons, the following options are treated as immutable after initialization: rehypePlugins, rehypeReactOptions, remarkParseOptions, remarkPlugins, remarkToRehypeOptions, components, and onError. Changing them dynamically will have no effect during the component's lifecycle.

Remark Component

The <Remark> component accepts the same options as useRemark, but you pass the markdown content as its children:

<Remark>{markdown}</Remark>

Types

Components

import { ComponentType, JSX } from "react";
type Components = { [Key in keyof JSX.IntrinsicElements]?: ComponentType<JSX.IntrinsicElements[Key] & { node?: Element }> | keyof JSX.IntrinsicElements };

PluggableList

import type { PluggableList } from "unified";

RehypeReactOptions

import type { Components } from "hast-util-to-jsx-runtime";

type RehypeReactOptions = { components?: Partial<Components> };

RemarkParseOptions

import type { Options } from "remark-parse";

type RemarkParseOptions = Options;

RemarkRehypeOptions

import type { Options } from "remark-rehype";

type RemarkRehypeOptions = Options;

UpdateMode

type UpdateMode = "immediate" | "throttle" | "debounce";

License

This project is licensed under the MIT License.