Skip to content

vrlab-tech/react-slate-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published