@artibox/slate-editor
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@artibox/slate-editor

Slate editor.

npm package npm downloads

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}
    />
  );
}

API

Dependencies (9)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @artibox/slate-editor

    Weekly Downloads

    1

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    22.1 kB

    Total Files

    28

    Last publish

    Collaborators

    • fantasywind