SmartBlock - A Modern Block Based Wysiwyg Editor using React and ProseMirror

January 19, 2020 0 Comments

SmartBlock - A Modern Block Based Wysiwyg Editor using React and ProseMirror

 

 

Install the package via npm

$ npm install smartblock --save

Load JavaScript from CDN

Usage

As an React

In your JavaScript file:

import * as React from 'react'; import { render } from 'react-dom'; import { SmartBlock, GlobalStyle, Extensions } from 'smartblock'; render(<> <GlobalStyle /> <SmartBlock extensions={Extensions} html={'<h2>Hello World</h2><p>hello</p>'} onChange={({ json, html }) => { console.log(json, html);}} /> </>, document.getElementById("app")  
);

As an Native JavaScript

<script src="https://unpkg.com/smartblock@1.2.2/dist/smartblock.js"></script> <script>  
SmartBlock('#app', { html: '<h2>Hello World</h2><p>hello</p>', onChange: function(result) { console.log(result.json, result.html); }  
});  
</script>

Compatibility

IE11, and Edge, iOS Safari, Firefox, Chrome, Safari

Usage, introduction of other functions, component introduction etc.
are described in detail in the document.

Get Started

SmartBlock was developed by @appleplecom and is open source (MIT license) on GitHub.
Please send us feedback, requests, bug reports and pull requests!

If you like it, please press Star ;)

GitHub page


Tag cloud