react-native-enriched-markdown is a powerful React Native library that renders Markdown content as native text and provides a rich text input with Markdown output. It supports iOS, Android, macOS, and Web, and requires the New Architecture (Fabric) for native platforms.
- ⚡ Fully native text rendering (no WebView)
- 🌐 Web support via react-native-web + md4c compiled to WebAssembly
- 🎯 High-performance Markdown parsing with md4c
- 📐 CommonMark standard compliant
- 📊 GitHub Flavored Markdown (GFM)
- 🧮 LaTeX math rendering (block
$$...$$withflavor="github", inline$...$in all flavors) - 🔀 Markdown Streaming: new text fades in, incomplete blocks are held back and half-written syntax is repaired as an LLM streams
- 🎨 Fully customizable styles for all elements
- ✨ Text selection and copy support
- 📌 Custom text selection context menu items
- 🔗 Interactive link handling with per-URL-pattern styling (
linkVariants) - 💊 Native link pills — links as rounded chips with an icon and label, per URL pattern or per link (iOS, Android)
- 📎 Long-press menus for links with your own items per URL pattern (
linkContextMenuItems, iOS 17+) - 👤 Renders mentions as styled links (compatible with
EnrichedMarkdownTextInputmention output) - 🙈 Spoiler text with animated particle overlay and tap-to-reveal
- 🖼️ Native image interactions (iOS: Copy, Save to Camera Roll)
- 🎬 Native video playback — block-level videos via HTML
<video>tag - 🌐 Native platform features (Translate, Look Up, Search Web, Share)
- 🗣️ Accessibility support (VoiceOver on iOS, TalkBack on Android, semantic HTML on web)
- 🔄 Full RTL (right-to-left) support including text, lists, blockquotes, tables, and task lists
- ✏️ Rich text input with Markdown output
- 🕹️ Imperative API for toggling styles and managing links
- 📋 Native context menu with formatting submenu
- 🔍 Real-time style state detection
- 🔗 Auto-link detection with customizable regex
- 🔄 Smart copy/paste with Markdown preservation
- 🎨 Customizable bold, italic, and link colors
- 👤 Mentions with configurable indicators, suggestion lifecycle events, and per-pattern link styling
Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.
- Prerequisites
- Installation
- Native assets (install-time download)
- EnrichedMarkdownText
- EnrichedMarkdownTextInput
- API Reference
- Testing with Jest
- Web Support
- macOS Support
- Compatibility Table
- Contributing
- Future Plans
- License
Native (iOS / Android / macOS)
- Requires the React Native New Architecture (Fabric)
- See Compatibility Table for supported React Native versions
- macOS support via react-native-macos
0.81+
Web
- Requires
react-native-web(or areact-native→react-native-webalias); the package'sbrowserfield points web bundlers at the web build - No New Architecture requirement — the web renderer runs entirely in JavaScript via WebAssembly
EnrichedMarkdownTextandEnrichedMarkdownTextInputboth run on web; see Web Support for what is not supported there. The web editor is covered in Web Editor- LaTeX math requires the optional
katexpeer dependency
No steps beyond having react-native-web configured. For LaTeX math, install the optional peer dependency:
npm install katex
# or
yarn add katexSee Web Support for full setup details, supported features, and prop behaviour.
yarn add react-native-enriched-markdownTip
To try the latest features before they land in a stable release, install the nightly build:
yarn add react-native-enriched-markdown@nightlyNightly versions are published to npm automatically and may contain breaking changes.
Note
On install, a postinstall script downloads the large native assets used by code highlighting
and iOS LaTeX math (kept out of the npm tarball to keep it ~1 MB). This needs network access to
registry.npmjs.org and github.com. If you install offline, with --ignore-scripts, or with
pnpm (which blocks dependency scripts by default), see
Native assets for how to restore them.
Add an "enriched-markdown" block to your app's package.json to configure which features are enabled:
{
"enriched-markdown": {
"enableCodeHighlight": true,
"enableMath": true,
"enableVideo": true,
"codeHighlightLanguages": ["javascript", "typescript", "python", "swift", "kotlin"]
}
}| Key | Type | Default | Description |
|---|---|---|---|
enableCodeHighlight |
boolean |
true |
Download and compile tree-sitter grammars for syntax highlighting |
enableMath |
boolean |
true |
Download RaTeX for LaTeX math rendering (iOS) and include the Maven dependency (Android) |
enableVideo |
boolean |
true |
Enable native video playback. Adds Media3 ExoPlayer (~2-3 MB) on Android; uses built-in AVKit on iOS. Set to false to exclude the dependency |
codeHighlightLanguages |
string[] |
all default grammars | Subset of languages to compile (reduces binary size). Ignored when enableCodeHighlight is false; an empty array [] compiles none (same as disabling). |
Your app's package.json is the single source of truth. postinstall reads it to decide
what to download into node_modules, and the native build (iOS podspec / Android
build.gradle) reads it directly to decide what to compile and link — no Podfile ENV
vars or gradle.properties edits needed. Changing a value takes effect on your next
pod install / native rebuild; enabling a feature that was off also needs a reinstall
(npm install / npm rebuild react-native-enriched-markdown) so its assets get downloaded.
Important
iOS applies config at pod install, not at build time. After editing the enriched-markdown
block, run pod install (a plain run-ios reuses the previously resolved pod). When disabling a
feature that was already compiled in — or narrowing codeHighlightLanguages — also do a clean build
(Product > Clean Build Folder), since Xcode's incremental build can link a stale pod library.
Android reconfigures on every build and needs neither step.
Tip
If you don't use a feature, disabling it skips the download and excludes it from the native build. See Skipping the download for details.
Note
Monorepos: the native build reads the app's package.json (the one next to
ios//android/), so each app can enable/disable features independently. The download
opt-out is resolved where you run the install — usually the workspace root — so to skip a
download entirely, put the opt-out in the root package.json.
Note
Migrating from the Expo config plugin or the ENV / gradle.properties build flags? See
Breaking changes.
The library includes native code so you will need to re-build the native app.
# iOS
cd ios && bundle install && bundle exec pod install
# macOS (react-native-macos)
cd macos && bundle install && bundle exec pod installIf your app uses React Native's experimental Swift Package Manager setup (React Native 0.88+)
instead of CocoaPods, run this instead of pod install:
npx react-native spmThe library ships a Package.swift and reads the same enriched-markdown block. Run
npx react-native spm again after editing the block, as you would pod install. Without it, the
change reaches the build one build later. The block is applied to the installed package, so in a
monorepo several Swift Package Manager apps sharing one copy of the library build with the block of
whichever app ran npx react-native spm last.
npx expo install react-native-enriched-markdownThe library includes native code so you will need to re-build the native app.
npx expo prebuildNote
The library won't work in Expo Go as it needs native changes.
Note
npx expo install runs the same postinstall asset download described under
Native assets; it needs network access and does not work with Yarn PnP.
Important
iOS: Save to Camera Roll
If your Markdown content includes images and you want users to save them to their photo library, add the following to your Info.plist:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs access to your photo library to save images.</string>See EnrichedMarkdownText for detailed documentation on usage examples, GFM tables, task lists, link handling, supported elements, copy options, accessibility, RTL support, and customizing styles. Mentions created by EnrichedMarkdownTextInput render as styled links — use linkVariants to customize their appearance.
See EnrichedMarkdownTextInput for detailed documentation on usage examples, inline styles, links, style detection, events, and customizing styles.
See the API Reference for a detailed overview of all the props, methods, and events available.
See Web Support for details on supported features, web-specific prop behaviour, and known limitations.
react-native-enriched-markdown supports macOS via react-native-macos. See macOS Support for details on macOS-specific features, known limitations, and the example app.
We're actively working on expanding the capabilities of react-native-enriched-markdown. Here's what's on the roadmap:
EnrichedMarkdownTextInput: blockquotes, code blocks, inline imagesEnrichedMarkdownTextInputon web: links and mentions- macOS: block math rendering, VoiceOver accessibility, streaming animations
- Web (
EnrichedMarkdownText): particle spoilers, streaming animation, configurable linktarget, copy options (Copy as Markdown, multi-format clipboard)
| 0.82 | 0.83 | 0.84 | 0.85 | 0.86 | 0.87 | 0.88 | |
|---|---|---|---|---|---|---|---|
| nightly | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 1.2.0 | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 1.1.x | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 1.0.x | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 0.7.0 | ⛔ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 0.6.0 | ⛔ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ |
| 0.5.0 | ⛔ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ |
| 0.4.x | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
| 0.3.0 | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
See the contributing guide to learn how to contribute to the repository and the development workflow.
react-native-enriched-markdown library is licensed under The MIT License.
Built by Software Mansion.