Skip to main content

useEnrichedMarkdownStyle

Resolve the theme-derived MarkdownStyle (typed directly from react-native-enriched-markdown) used by MarkdownTypography and the underlying EnrichedMarkdownText. Each markdown element — headings, paragraphs, lists, code, blockquotes, tables, links, and more — is mapped to the active theme's colors, fonts, and variables.

MarkdownTypography applies this internally, so you only need this hook when you want to customize the default styling or drive EnrichedMarkdownText yourself.

Usage​

import { useEnrichedMarkdownStyle } from '@multinaire/expo-ui';
import { EnrichedMarkdownText } from 'react-native-enriched-markdown';

function CustomMarkdown({ markdown }: { markdown: string }) {
const { style } = useEnrichedMarkdownStyle();

return <EnrichedMarkdownText markdown={markdown} markdownStyle={style} />;
}

Return Value​

PropertyTypeDescription
styleMarkdownStylePer-element style object mapping each markdown element to theme tokens.