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

https://github.com/danrpts/react-mdex

An ultralight library for building Markdown editors in React.
https://github.com/danrpts/react-mdex

editor library markdown react

Last synced: 2 months ago
JSON representation

An ultralight library for building Markdown editors in React.

Awesome Lists containing this project

README

        

# react-mdex

> An ultralight library for building Markdown editors in React - [Try it out!](https://superdan.io/react-mdex/)

[![NPM](https://img.shields.io/npm/v/react-mdex.svg)](https://www.npmjs.com/package/react-mdex) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

![commonmark_editor_screenshot.png](./example/commonmark_editor_screenshot.png)

## Install

```bash
npm install --save react-mdex
```

## Usage

```jsx
import React, { Component } from "react";
import MarkdownIt from "markdown-it";
import { Editor, EditorState, Preview } from "react-mdex";

class BasicEditor extends Component {
constructor(props) {
super(props);

this.state = {
editorState: new EditorState()
};

this.onChange = editorState => {
this.setState({
editorState
});
};

const md = MarkdownIt();
this.renderFn = md.render.bind(md);
}
render() {
return (





);
}
}
```

## License

MIT © [danrpts](https://github.com/danrpts)