COMPARISON · MARKDOWN

@mdx-js/react vs. shiki

Side-by-side comparison · 9 metrics · 14 criteria

@mdx-js/react v3.1.1 · MIT
Weekly Downloads
33.3M
Stars
19.9K
Gzip Size
3.4 kB
License
MIT
Last Updated
1y ago
Open Issues
22
Forks
1.2K
Unpacked Size
14.4 kB
Dependencies
2
shiki v4.6.0 · MIT
Weekly Downloads
42.0M
Stars
14.0K
Gzip Size
65.4 kB
License
MIT
Last Updated
8mo ago
Open Issues
115
Forks
619
Unpacked Size
602.0 kB
Dependencies
8
DOWNLOAD TRENDS

@mdx-js/react vs shiki downloads · last 12 months

Download trends for @mdx-js/react and shiki2 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.031.0M62.0M93.0M124.0MNov 2025FebMayAugOct 2026
@mdx-js/react
shiki
FEATURE COMPARISON

Criteria · @mdx-js/react vs shiki

Gzip Footprint
@mdx-js/react ✓
Smaller reported gzip bundle at 3.4 kB
shiki
Larger reported gzip bundle at 65.4 kB
Learning Focus
@mdx-js/react
Understanding MDX use through React context
shiki
Understanding the syntax-highlighting use case
Adoption Signal
@mdx-js/react
More weekly downloads than shiki’s stars do not indicate; stars and forks are higher
shiki
Higher weekly downloads, with fewer stars and forks
Open Issue Count
@mdx-js/react ✓
Fewer open issues reported
shiki
More open issues reported
Primary Use Case
@mdx-js/react
React context integration for MDX content
shiki
Syntax highlighting for source code
Complementary Use
@mdx-js/react
Can handle MDX context alongside a separate highlighter
shiki
Can handle code highlighting alongside MDX integration
React Integration
@mdx-js/react ✓
Directly scoped to React context
shiki
No React-specific role stated
Unpacked Footprint
@mdx-js/react ✓
Smaller unpacked distribution at 14.4 kB
shiki
Larger unpacked distribution at 602.0 kB
Syntax Highlighting
@mdx-js/react
Does not provide a stated highlighting role
shiki ✓
Dedicated to syntax highlighting
Scope of Integration
@mdx-js/react
Application-level React and MDX integration
shiki
Code presentation within a consuming interface
MDX Component Context
@mdx-js/react ✓
Provides context for MDX in React
shiki
Does not provide the stated MDX context role
Content Rendering Role
@mdx-js/react
Connects MDX content with React rendering
shiki
Focuses on highlighted code output
Code Sample Presentation
@mdx-js/react
Not positioned for code coloring
shiki ✓
Designed to present highlighted source
Migration Interchangeability
@mdx-js/react
Cannot replace dedicated highlighting without changing functionality
shiki
Cannot replace MDX React context without changing functionality
VERDICT

@mdx-js/react is best understood as the React integration layer for MDX, aimed at developers rendering MDX content inside React applications. Its stated role is deliberately narrow: it supplies React context for MDX, rather than performing syntax coloring, so it suits projects whose central requirement is connecting MDX-authored content with React components. Choose it when the content model and component integration matter more than code-token presentation.

shiki is a syntax highlighter for developers who want source code to be rendered with language-aware highlighting. Its focus is presentational rather than React-specific: it addresses how code looks, not how MDX content receives React component mappings. It is therefore a closer fit for documentation or content views where highlighted code samples are a primary feature, including pages that may or may not use MDX.

The architectural distinction is the clearest selection point. @mdx-js/react exposes a React context role, which places its contribution in the flow between MDX content and React rendering; shiki’s stated purpose is to transform code into highlighted output. These roles are complementary in a site that has both MDX pages and highlighted examples, but they are not interchangeable: choosing shiki does not provide MDX’s React context, and choosing @mdx-js/react does not add syntax highlighting.

Their extension concerns also differ. With @mdx-js/react, developers work around MDX content and React components, using the package where React needs context for that content; with shiki, the core concern is recognizing and presenting source code through syntax-highlighting behavior. The supplied details do not specify either package’s extension API, so a decision should be based on the required output and integration point rather than presumed plugin capabilities. A project needing both content-component wiring and highlighted snippets may use each for its distinct role.

The learning curve follows those different scopes. A React developer evaluating @mdx-js/react can focus on how MDX content participates in the application’s React context, while a shiki user must focus on the code-highlighting use case and how its output fits the consuming interface. The supplied information does not establish comparative TypeScript support, debugging features, or detailed APIs, so those should be checked against the actual project requirements rather than inferred from package descriptions. The key practical distinction is whether the task begins with MDX component integration or with source-code presentation.

For size-sensitive deployments, @mdx-js/react has a clear numerical advantage in the supplied distribution figures: its reported gzip bundle is 3.4 kB, compared with 65.4 kB for shiki, and its unpacked size is 14.4 kB versus 602.0 kB. That makes @mdx-js/react the lighter choice when its React-context role is all the application needs. The size gap is relevant when evaluating client-side cost, but it is not evidence that shiki is an equivalent substitute; its syntax-highlighting purpose is different, and the figures alone do not establish runtime performance.

For an MDX-based React site that needs React context for rendering its authored content, select @mdx-js/react; for a code-focused view that needs syntax-highlighted samples, select shiki. A documentation application with both MDX pages and substantial code examples can have a reason to use both, assigning component integration to @mdx-js/react and code presentation to shiki. Avoid choosing based only on downloads: shiki leads weekly downloads, while @mdx-js/react leads in stars and forks, and those adoption measures do not determine functional fit.

Migration is not a direct swap because the packages address different layers of a content interface. Replacing @mdx-js/react with shiki would leave the stated React-context need unmet, while replacing shiki with @mdx-js/react would remove the dedicated syntax-highlighting role; a migration between them therefore requires changing the feature being provided, not just adjusting an import. For long-term maintenance planning, the supplied data shows 21 open issues for @mdx-js/react and 107 for shiki, but issue counts alone do not establish resolution quality or future support.

A useful edge case is a small React application that renders MDX but contains few or no code samples: @mdx-js/react aligns with that narrow integration need, while shiki’s highlighting capability may not be required. Conversely, a code-reference interface that is not built around React context can still have a direct reason to evaluate shiki. The packages can coexist when content composition and syntax presentation are separate requirements, but neither package should be treated as a drop-in replacement for the other.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

RELATED COMPARISONS 8
@mdx-js/react vs rehype ★ 22.1K · 38.7M/wk @mdx-js/react vs remark ★ 28.9K · 44.4M/wk @mdx-js/react vs mdast-util-mdx-jsx ★ 19.9K · 103.3M/wk @mdx-js/react vs marked ★ 57.2K · 168.6M/wk rehype vs shiki ★ 16.2K · 47.3M/wk mdast-util-mdx-jsx vs shiki ★ 14.0K · 111.9M/wk marked vs shiki ★ 51.3K · 177.2M/wk remark vs shiki ★ 23.0K · 53.0M/wk