iddan / react-universal-markdown

Markdown component for Web and Native powered by CommonMark
11 stars 3 forks source link

NPM Version Known Vulnerabilities Coverage Status

Markdown Logo React Logo

react-universal-markdown

Markdown component for Web and Native powered by CommonMark

npm install react-universal-markdown

Usage

With React DOM

import React, { Component } from 'react'
import Markdown from 'react-universal-markdown/dom'

export default class App extends Component {
  render() {
    return (
      <Markdown>{`
        Your markdown text
      `}</Markdown>
    )
  }
}

With React Native

import React, { Component } from 'react'
import Markdown from 'react-universal-markdown/native'

export default class App extends Component {
  render() {
    return (
      <Markdown>{`
        Your markdown text
      `}</Markdown>
    )
  }
}

API

DOMMarkdown

Props

...Markdown Props

DOMComponents

DOMMarkdown default components prop value

NativeMarkdown

Props

...Markdown Props

NativeComponents

NativeComponents default components prop value

Markdown

Props