Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geyang/react-markdownit
https://github.com/geyang/react-markdownit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/geyang/react-markdownit
- Owner: geyang
- License: mit
- Created: 2016-06-25T00:44:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T09:28:45.000Z (over 7 years ago)
- Last Synced: 2024-04-25T05:42:50.514Z (8 months ago)
- Language: JavaScript
- Size: 142 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 */}
{`
## Header1. 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