react-slate-editor

A rich editor based on slate framework

Usage no npm install needed!

<script type="module">
  import reactSlateEditor from 'https://cdn.skypack.dev/react-slate-editor';
</script>

README

React Slate Editor

A rich text editor based on SlateJS framework

version npm downloads Licence

Installation

The slate-editor is available as an npm package.

Usage

Basic example

import React from 'react'
import Editor from 'react-slate-editor'

const toolbar = ['bold', 'italic', 'underline', 'code', 'fontSize', 'sizeUp', 'sizeDown', 'link', 'image', 'orderedList', 'unorderedList', 'alignment']

function App() {

  function onEditorChange(value) { // function for set your state or post to your api
    postToApi(value) // html file ready to be saved to server
  }

  return (
    <Editor
      initialValue={'<p></p>'}
      onEditorChange={onEditorChange}
      toolbar={toolbar} //customize your toolbar
      uploadServerLink={'https://whereyouuploadit.com'} // add your upload api link here
      accessToken={'add your server token'} // give me some access please
    />
  );
}
export default App;

References

  • SlateJS - A completely customizable framework for building rich text editors.