Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/geyang/react-markdownit


https://github.com/geyang/react-markdownit

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# react-markdown

A React component for rendering Markdown with [markdown-it](https://github.com/markdown-it/markdown-it).

## Install

```
npm install --save react-markdownit
```

## Usage

```jsx
var React = require('react')
var Markdown = require('react-markdownit')

class Example extends React.Component {
render() {
return (


{/* Pass Markdown source to the `source` prop */}

{/* Or pass it as children */}
{/* You can nest React components, too */}

{`
## Header

1. One
2. Two
`}

Nested component

{`Test`}


)
}
}
```

## Props

### options

Type: `object`

Options for `markdown-it`.

### source

Type: `string`

Markdown source. You can also pass the source as children,
which allows you to mix React components and Markdown.

### container

Element to use as container. Defaults to `div`.

## License

MIT