A rich text editor based on SlateJS framework
The slate-editor is available as an npm package.
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;
- SlateJS - A completely customizable framework for building rich text editors.