Skip to content

A React component for rendering Markdown with remarkable

Notifications You must be signed in to change notification settings

peakon/react-remarkable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-remarkable

A React component for rendering Markdown with remarkable.

npm install --save react-remarkable

Usage

var React = require('react');
var Markdown = require('react-remarkable');

var MyComponent = React.createClass({

  render() {
    return (
      <div>
        {/* Pass Markdown source to the `source` prop */}
        <Markdown source="**Markdown is awesome!**" />

        {/* Or pass it as children */}
        {/* You can nest React components, too */}
        <Markdown>
          ## Reasons React is great

          1. Server-side rendering
          2. This totally works:

          <SomeOtherAmazingComponent />

          Pretty neat!
        </Markdown>
      </div>
    );
  }

});

Available props:

  • options - Hash of Remarkable options
  • source - 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 span.
  • sanitize - Function. Callback hook as an opportunity to transform the Markdown output before adding it to the DOM.

License

MIT

About

A React component for rendering Markdown with remarkable

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%