The Markdown content to render.
| Type | Default Value | Platform |
|---|---|---|
string |
Required | Both |
Style configuration for Markdown elements. See the Style Properties Reference for a detailed overview of all available style properties.
| Type | Default Value | Platform |
|---|---|---|
MarkdownStyle |
{} |
Both |
Style for the container view.
| Type | Default Value | Platform |
|---|---|---|
ViewStyle |
- | Both |
Callback when a link is pressed. Access URL via event.url.
| Type | Default Value | Platform |
|---|---|---|
(event: LinkPressEvent) => void |
- | Both |
Note: For handling long-press gestures on links, see
onLinkLongPress. On iOS, providingonLinkLongPressautomatically disables the system link preview.
Example:
<EnrichedMarkdownText
markdown="Check out [React Native](https://reactnative.dev)!"
onLinkPress={({ url }) => {
Alert.alert('Link pressed', url);
Linking.openURL(url);
}}
/>Callback when a link is long pressed. Access URL via event.url. On iOS, automatically disables the system link preview.
| Type | Default Value | Platform |
|---|---|---|
(event: LinkLongPressEvent) => void |
- | Both |
Example:
<EnrichedMarkdownText
markdown="Check out [React Native](https://reactnative.dev)!"
onLinkLongPress={({ url }) => {
Alert.alert('Link long pressed', url);
}}
/>Callback when a task list checkbox is tapped. Receives index (0-based), checked (new state after toggling), and text (item text).
| Type | Default Value | Platform |
|---|---|---|
(event: TaskListItemPressEvent) => void |
- | Both |
Controls the native link preview on long press (iOS only). Automatically set to false when onLinkLongPress is provided.
| Type | Default Value | Platform |
|---|---|---|
boolean |
true |
iOS |
By default, long-pressing a link on iOS shows the native system link preview. When you provide onLinkLongPress, the system preview is automatically disabled so your handler can fire instead.
You can also control this behavior explicitly without providing a handler:
// Disable system link preview without providing a handler
<EnrichedMarkdownText
markdown={content}
enableLinkPreview={false}
/>Whether text can be selected.
| Type | Default Value | Platform |
|---|---|---|
boolean |
true |
Both |
Configuration for md4c parser extension flags.
| Type | Default Value | Platform |
|---|---|---|
Md4cFlags |
{ underline: false } |
Both |
Properties:
underline: Whentrue, treats_text_as underline instead of emphasis. When enabled, only*text*works for italic emphasis.
Example:
// Default: _text_ is treated as italic
<EnrichedMarkdownText
markdown="This is _italic_ text"
/>
// With underline enabled: _text_ is underlined, *text* is italic
<EnrichedMarkdownText
markdown="This is _underlined_ and *italic* text"
md4cFlags={{ underline: true }}
/>Whether fonts should scale to respect Text Size accessibility settings.
| Type | Default Value | Platform |
|---|---|---|
boolean |
true |
Both |
Maximum font scale multiplier when allowFontScaling is enabled.
| Type | Default Value | Platform |
|---|---|---|
number |
undefined |
Both |
Whether to preserve the bottom margin of the last block element.
| Type | Default Value | Platform |
|---|---|---|
boolean |
false |
Both |
Markdown flavor. Set to 'github' to enable GitHub Flavored Markdown table support.
| Type | Default Value | Platform |
|---|---|---|
'commonmark' | 'github' |
'commonmark' |
Both |
Note:
'commonmark': All Markdown content is rendered as a single TextView. Selecting text will select all content in the view.'github': The Markdown AST is split into segments. Consecutive text blocks (paragraphs, headings, lists, etc.) are grouped into separate TextView segments, while tables are rendered as separate table views. This allows for granular text selection within each segment and enables interactive table features (horizontal scrolling, context menus). Text selection cannot span across segments.