PACKAGE · MARKDOWN

@mdx-js/react

React context for MDX

WEEKLY DOWNLOADS 33.3M
STARS 19.9K
FORKS 1.2K
OPEN ISSUES 22
GZIP SIZE 3.4 kB
UNPACKED SIZE 14.4 kB
DEPENDENCIES 2
LAST UPDATED 1y ago
DOWNLOAD TRENDS

@mdx-js/react downloads · last 12 months

Download trends for @mdx-js/react1 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.026.8M53.6M80.3M107.1MNov 2025FebMayAugOct 2026
@mdx-js/react
ABOUT @MDX-JS/REACT

@mdx-js/react provides React context for MDX, connecting MDX content with React components. It addresses the need to supply component mappings to rendered MDX so elements in authored content can resolve to application-defined React components instead of relying only on their default rendering.

The package is focused rather than a general-purpose React state or rendering framework: it supplies the context layer for MDX component customization. Its primary audience is developers integrating MDX into React applications who want a consistent way to define or provide components for content; it is not the tool that parses or compiles MDX source.

The main integration pattern is to provide component mappings through the package’s React context and make them available while rendering MDX. This lets application code centralize mappings for elements used in MDX, rather than embedding separate component-selection logic in each piece of content. The package description identifies React context as its role; consult its documentation for exact API signatures and version-specific usage.

Use it within a React and MDX workflow, alongside the tools responsible for authoring, compiling, or otherwise processing MDX. Its listed topics include JSX, Markdown, MDX, React, remark, and unified, but the package itself is specifically the React context integration point, not a general integration layer for every framework in those topics.

Version 3.1.1 is listed with an unpacked size of 14.4 kB and a gzip bundle size of 3.4 kB, so the reported package footprint is compact. The supplied package data also reports 8.4M weekly downloads, 19.8K GitHub stars, 1.2K forks, and 21 open issues, with a last-updated date of 2026-10-20; these figures describe package activity, not a guarantee about compatibility or support.

A key boundary is that @mdx-js/react provides React context for MDX rather than Markdown parsing, MDX compilation, or a standalone content pipeline. It is also specifically oriented around React, so applications rendering MDX without React should use an integration suited to their framework instead; verify the package’s documented APIs and compatibility requirements for your setup.

WHEN TO USE
  • When rendering MDX in a React application and you want MDX elements to resolve through shared React component mappings, use the package’s context integration.
  • When application-defined React components should replace or customize elements used in MDX content, provide those mappings through the MDX React context rather than duplicating selection logic across content.
  • When several MDX documents in a React rendering flow should use a consistent component mapping, centralize that mapping with the package’s context pattern.
  • When your MDX workflow already handles authoring or compilation elsewhere and needs the React-specific component context layer, use @mdx-js/react for that integration boundary.
  • When you need a compact package focused on React context for MDX, consider its reported 3.4 kB gzip bundle size as the package footprint.
WHEN NOT TO USE
  • If you need to parse or compile Markdown or MDX source, use a parsing or compilation workflow; @mdx-js/react provides React context, not source transformation.
  • If your application does not render MDX through React, choose an integration for its rendering framework; this package is specifically described as React context for MDX.
  • If MDX content can use only its default element rendering and no application component mappings, the context layer may add no value; render the content without custom mappings.
  • If you need a complete content pipeline for authoring, compilation, and rendering, do not treat @mdx-js/react as the whole pipeline; pair a React context layer with tools that perform the other stages.
  • If you need an API for general React state or context unrelated to MDX component mappings, use React’s general-purpose context mechanisms instead; this package is scoped to MDX integration.
  • If you require exact API behavior or compatibility guarantees not stated in the supplied package details, check the version 3.1.1 documentation before adopting it rather than inferring support from package statistics.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 5
@mdx-js/react vs rehype ★ 2.3K · 5.3M/wk @mdx-js/react vs shiki ★ 14.0K · 42.0M/wk @mdx-js/react vs remark ★ 9.0K · 11.0M/wk @mdx-js/react vs mdast-util-mdx-jsx ★ 35 · 70.0M/wk @mdx-js/react vs marked ★ 37.3K · 135.3M/wk