Overview
react-wikitext renders MediaWiki-style wikitext as React elements. Source text is parsed into a typed semantic AST, converted to HAST, and handed to React. It does not talk to the MediaWiki API, execute Lua, or own your routes.
What it solves
A common shortcut is to inject pre-rendered HTML with dangerouslySetInnerHTML, or to embed a wiki page in an iframe. Neither composes well: the first bypasses React, and the second cannot reuse your styles or interactions.
react-wikitext outputs React elements instead of HTML strings. It exposes an inspectable semantic tree and a sanitized HAST before rendering, leaves links, images, and templates to the host, and can parse and prepare on the server, in a worker, or behind a cache while the client receives a snapshot.
Capabilities
Default output
The example below configures no resolvers. Template and file placeholders and non-navigable links are expected defaults, not render failures:
Default output
This paragraph mixes bold, italic, and an internal link.
Template not expanded: Infobox
- title=Templates are not evaluated by default
See Rendering behavior and Syntax support for the full boundaries.
Deliberate limits
The default pipeline does not evaluate templates or parser functions, and it never runs Lua; /expand covers a supported subset only. The library makes no network requests, does not load images by default, and leaves internal links non-navigable.
It is not a MediaWiki implementation and includes no editor or virtual list. The site API, editing, full extension semantics, and pagination belong to the host. See Rendering behavior for details.
When it fits
It suits read-only wiki mirrors, archives, and exports, and wiki snippets embedded in knowledge bases, documentation sites, or admin consoles. It also fits cases that need structured content before rendering, per-block fault isolation, parsing in a worker, or links, images, and templates wired to your own router, CDN, and backend.
Other tools fit better in these cases:
Current status
Version 0.1.0-alpha.1, published on the alpha dist-tag and installed with pnpm add react-wikitext@alpha. Releases in the 0.x range follow semantic versioning: minor versions may contain breaking changes, and patch versions only carry compatible fixes. React >=18.2 <20; Node >=18.18 for builds or server execution. The parser is pinned to wikiparser-node@1.48.1; the license is GPL-3.0-or-later.
See Status and compatibility for the full matrix.
Next steps
- Quick start: install and render a first snippet.
- How it works: the pipeline, snapshots, and entry boundaries.
- Syntax support: whether a construct renders, becomes a placeholder, or degrades.