@artibox/slate-editor
v1.2.0
Published
<div align="center"> <img src="https://raw.githubusercontent.com/ianstormtaylor/slate/master/docs/images/banner.png" height="200" /> </div>
Downloads
34
Readme
Slate editor.
Installation
npm install @artibox/slate-editor --save
or
$ yarn add @artibox/slate-editor
Usage
import React from 'react';
import { createArtiboxEditor } from '@artibox/slate-editor';
const initialValue = ...;// from slate
const plugins = [
// ...
];
const ArtiboxEditor = createArtiboxEditor({
plugins
});
const YourEditor = () => {
const [value, setValue] = useState(initialValue);
const onChange = useCallback(change => setValue(change.value), []);
return (
<ArtiboxEditor
value={value}
onChange={onChange}
/>
);
}