DraftJS Divider Plugin
This is a plugin for the draft-js-plugins-editor
.
Usage
; const dividerPlugin = ;
It exposes addDivider
function and DividerButton
.
You can use this plugin like below.
/* eslint-disable */ ; ; ; ;;; ;; const dividerPlugin = ; const DefaultBlockTypeSelect = <BlockTypeSelect getEditorState=getEditorState setEditorState=setEditorState theme=theme structure=dividerPluginDividerButton />; const sideToolbarPlugin = ; ; const plugins = sideToolbarPlugin dividerPlugin;const SideToolbar = sideToolbarPlugin; state = editorState: ; { this; }; { return <div className="App"> <div className="editor"> <Editor placeholder="placeholder ..." readOnly=false editorState=thisstateeditorState onChange=thisonChange plugins=plugins ref= { thiseditor = element; } /> <SideToolbar /> </div> </div> ; } ;
Importing the default styles
The plugin ships with a default styling available at this location in the installed package:
draft-js-divider-plugin/lib/plugin.css
.
If you want to use the default styles, you can include this stylesheet.
Otherwise you can supply your own styles via the theme
config option.