1.0.1 • Published 2 years ago

@draft-js-enhance-plugins/blockquote v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

DraftJS Blockquote Plugin

This is a plugin for the @draft-js-plugins/editor.

Feature

  • Press enter to insert new line in the same block

TODO

  • Support depth value
  • Press tab or shift+tab to adjust the depth

Usage

import { EditorState } from 'draft-js';
import Editor from '@draft-js-plugins/editor';
import createBlockquotePlugin from '@draft-js-enhance-plugins/blockquote';

const blockquotePlugin = createBlockquotePlugin();

const plugins = [blockquotePlugin];

function Example() {
  const [editorState, setEditorState] = useState(EditorState.createEmpty());

  return (
    <Editor
      editorState={editorState}
      onChange={setEditorState}
      plugins={plugins}
    />
  );
}