# react-markdown-editor **Repository Path**: voyllente/react-markdown-editor ## Basic Information - **Project Name**: react-markdown-editor - **Description**: 基于React的Markdown 编辑器组件。 - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: master - **Homepage**: http://uiw.gitee.io/react-markdown-editor/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 20 - **Created**: 2019-04-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

A markdown editor with preview, implemented with React.js and TypeScript.

## Install ```bash npm i @uiw/react-markdown-editor ``` ## Document Official document [demo preview](https://uiwjs.github.io/react-markdown-editor/) ([🇨🇳中国镜像网站](http://uiw.gitee.io/react-markdown-editor/)) ## Basic Usage ```jsx import MarkdownEditor from '@uiw/react-markdown-editor'; import React from 'react'; import ReactDOM from 'react-dom'; const Dome = () => ( ); ``` controlled usage ```jsx import MarkdownEditor from '@uiw/react-markdown-editor'; import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { constructor() { super(); this.state = { markdown: '# This is a H1 \n## This is a H2 \n###### This is a H6', }; this.updateMarkdown = this.updateMarkdown.bind(this); } updateMarkdown(editor, data, value) { this.setState({ markdown: value }); } render() { return ( ); } } ReactDOM.render( , document.getElementById('app') ); ``` ## Props - value (*string*) - the raw markdown that will be converted to html (**required**) - `visble?:boolean` - Shows a preview that will be converted to html. - `toolbars?:array` - Tool display settings. - `toolbarsMode?:array` - Tool display settings. - onChange (*function(editor: IInstance, data: CodeMirror.EditorChange, value: string)*) - called when a change is made (**required**) > [Other Props Options](https://github.com/uiwjs/react-markdown-editor/blob/8de6abbf628b6d272d7da1c28e985fbbcba71b93/src/components/CodeMirror/index.tsx#L21-L60) ### Development ```bash npm run dev npm run type-check:watch npm run doc ``` ## License [MIT © Kenny Wong](./LICENSE)