Skip to content

React Plugin Architecture for DraftJS including Slack-Like Emojis, FB-Like Mentions and Stickers

License

Notifications You must be signed in to change notification settings

bold/draft-js-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

DraftJS Plugins

Draft JS Plugins Logo

High quality plugins with great UX on top of DraftJS.

Build Status

Available Plugins

Built by the community

Live Example & Documentation

Checkout the website!

Usage

First, install the editor with npm:

$ npm install draft-js-plugins-editor --save 

and then import it somewhere in your code and you're ready to go!

importEditorfrom'draft-js-plugins-editor';

Documentation

draft-js-plugins-editor

Editor

An editor component accepting plugins.

PropsDescriptionRequired
editorStatesee here*
onChangesee here*
pluginsan array of plugins
all other props accepted by the DraftJS Editorsee here

Usage:

importReact,{Component}from'react';importEditorfrom'draft-js-plugins-editor';importcreateHashtagPluginfrom'draft-js-hashtag-plugin';importcreateLinkifyPluginfrom'draft-js-linkify-plugin';import{EditorState}from'draft-js';consthashtagPlugin=createHashtagPlugin();constlinkifyPlugin=createLinkifyPlugin();constplugins=[hashtagPlugin,linkifyPlugin,];exportdefaultclassUnicornEditorextendsComponent{state={editorState: EditorState.createEmpty(),};onChange=(editorState)=>{this.setState({ editorState,});};render(){return(<EditoreditorState={this.state.editorState}onChange={this.onChange}plugins={plugins}ref="editor"/>);}}

How to write a Plugin

Feel free to copy any of the existing plugins as a starting point. Feel free to directly contact @nikgraf in case you need help or open a Github Issue!

More documentation is coming soon…

Discussion and Support

Join the channel #draft-js-plugins after signing into the DraftJS Slack organization or check out or collection of frequently asked questions here: FAQ.

Development

Check out our Contribution Guide.

License

MIT

About

React Plugin Architecture for DraftJS including Slack-Like Emojis, FB-Like Mentions and Stickers

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript96.0%
  • CSS3.2%
  • Shell0.8%