1.0.11 • Published 3 years ago

react-antdown v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

version build test coverage

react-antdown

Simply put, this component wraps the output of react-markdown with a className of .ant-typography, ensuring that the HTML output of react-markdown will pick up CSS rules as defined by Ant Design.

Install

Install react-antdown npm module as a dependency of your antd project with npm.

npm install react-antdown --save

or, with yarn...

yarn add react-antdown

Basic Usage

import React from 'react'
import ReactAntdown from 'react-antdown'

const someMarkdown = `# This is the title

This is some text

* List item 1
* List item 2
  * List item 2.1
  * List item 2.2

This is a [link](https://www.google.com/?q=markdown)`

const MyComponent = () => {
  return (
    <ReactAntdown>
      {someMarkdown}
    </ReactAntdown>
  )
}

export default MyComponent

API

props

  • children (string, default: '')\ The Markdown to pass to ReactMarkdown
  • className (string?)\ Any additional className(s), to be appended to the defaults: 'react-antdown', 'ant-typography'

Any other props specified will be passed along to the internal instance of react-markdown.

The full list of props that react-markdown supports can be viewed in the react-markdown documentation on GitHub.

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago