react-native-md-webview

0.4.0 • Public • Published

react-native-md-webview

A simple webview wrapper that renders markdown using showdown.

Usage

The markdown you want to render should be passed directly as a child. eg: <MDWebView>{'# Hello!'}</MDWebView>

This package accepts the same props as WebView with the exception of url, html, and source, as these are used internally when rendering Markdown.

The following props can be passed in to customize the markdown:

  • css: CSS to render directly in the markdown HTML.
  • showdownOptions: Options to pass to showdown.Converter.

Example

import MDWebView from 'react-native-md-webview';
 
export default React.createClass({
  render() {
    return (
      <MDWebView css={css} style={{ flex: 1 }}>
        {this.props.markdown}
      </MDWebView>
    );
  },
});
 
const css = `
  img {
    width: 100%,
  }
`;

About thoughtbot

thoughtbot

react-native-md-webview is maintained and funded by thoughtbot. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software! See our other projects or hire us to design, develop, and grow your product.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.4.0
    0
  • 0.3.0
    0
  • 0.2.0
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i react-native-md-webview

Weekly Downloads

0

Version

0.4.0

License

MIT

Last publish

Collaborators