- Notifications
You must be signed in to change notification settings - Fork1.1k
React Plugin Architecture for Draft.js including Slack-Like Emojis, FB-Like Mentions and Stickers
License
draft-js-plugins/draft-js-plugins
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
High quality plugins with great UX on top ofDraftJS.
- Anchor
- Alignment
- Counter
- Drag and Drop
- Divider
- Emoji
- Focus
- Hashtag
- Image
- Inline Toolbar
- Linkify
- Mention
- Resizeable
- Side Toolbar
- Static Toolbar
- Sticker
- Text Alignment
- Undo
- Video
- or build your own … :)
- Autolist byMax Wheeler/Icelab
- Block Breakout byMax Wheeler/Icelab
- Markdown Shortcuts byAtsushi Nagase
- Single Line byMax Wheeler/Icelab
- RichButtons byjasonphillips
- Katex byletranloc
- Mathjax byefloti
- Buttons byStevenIseki
- Color Picker byStevenIseki
- Embed byStevenIseki
- EmojiPicker byStevenIseki
- GifPicker byStevenIseki
- Link byStevenIseki
- Modal byStevenIseki
- Sidebar byStevenIseki
- Toolbar byStevenIseki
- Divider bysimsim0709
- Code Editor byMax Stroiber/Spectrum
Checkoutthe website!
First, install the editor withnpm:
$ npm install @draft-js-plugins/editor --saveThen import the editor somewhere in your code and you're ready to go!
importEditorfrom'@draft-js-plugins/editor';
An editor component accepting plugins.see source
| Props | Description | Required |
|---|---|---|
| editorState | see here | * |
| onChange | see here | * |
| plugins | an array of plugins | |
| decorators | an array of custom decorators | |
| defaultKeyBindings | bool | |
| defaultBlockRenderMap | bool | |
| all other props accepted by the DraftJS Editor except decorator | see here |
Usage:
importReact,{Component}from'react';importEditorfrom'@draft-js-plugins/editor';importcreateHashtagPluginfrom'@draft-js-plugins/hashtag';importcreateLinkifyPluginfrom'@draft-js-plugins/linkify';import{EditorState}from'draft-js';consthashtagPlugin=createHashtagPlugin();constlinkifyPlugin=createLinkifyPlugin();constplugins=[linkifyPlugin,hashtagPlugin];exportdefaultclassUnicornEditorextendsComponent{state={editorState:EditorState.createEmpty(),};onChange=editorState=>{this.setState({ editorState,});};render(){return(<EditoreditorState={this.state.editorState}onChange={this.onChange}plugins={plugins}/>);}}
Feel free to copy any of the existing plugins as a starting point.In this repository you can also find aGuide on how to create a plugin, including a description of the supported features. In addition you can contact@nikgraf directly in case you need help or simply open a Github Issue!
Join the channel #draft-js-plugins after signing into the DraftJSSlack organization or check out our collection of frequently asked questions here:FAQ.
Check out ourContribution Guide.
In this talk Nik Graf explained the ContentState structure of a Draft.js Editor as well as explained how to use plugins.
MIT
About
React Plugin Architecture for Draft.js including Slack-Like Emojis, FB-Like Mentions and Stickers
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
