1.10.0 • Published 1 year ago

react-native-marked-non-list v1.10.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-marked

GitHub license CI Coverage Status npm npm

Markdown renderer for React Native powered by marked.js with built-in theming support

Installation

yarn add react-native-marked

Usage

import * as React from 'react';
import Markdown from 'react-native-marked';

const ExampleComponent = () => {
  return (
    <Markdown
      value={`# Hello world`}
      flatListProps={{
        initialNumToRender: 8,
      }}
    />
  );
};

export default ExampleComponent;

Examples

Props

PropDescriptionTypeOptional?
valueMarkdown valuestringfalse
flatListPropsProps for customizing the underlying FlatList usedOmit<FlatListProps<ReactNode>, 'data' \| 'renderItem' \| 'horizontal'>('data', 'renderItem', and 'horizontal' props are omitted and cannot be overridden.)true
stylesStyles for parsed componentsMarkedStylestrue
themeProps for customizing colors and spacing for all components,and it will get overridden with custom component style applied via 'styles' propUserThemetrue
baseUrlA prefix url for any relative linkstringtrue

Supported elements

  • Headings (1 to 6)
  • Paragraph
  • Emphasis (bold, italic, and strikethrough)
  • Link
  • Image
  • Blockquote
  • Inline Code
  • Code Block
  • List (ordered, unordered)
  • Horizontal Rule
  • Table
  • HTML

Ref: CommonMark

HTML will be treated as plain text

Screenshots

Dark ThemeLight Theme
Dark themeLight theme

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Built with