Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

React Plugin Architecture for Draft.js including Slack-Like Emojis, FB-Like Mentions and Stickers

License

NotificationsYou must be signed in to change notification settings

draft-js-plugins/draft-js-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Draft JS Plugins Logo

High quality plugins with great UX on top ofDraftJS.

Build Status

Available Plugins (incl. Docs)

Built by the community

Live Example & Documentation

Checkoutthe website!

Usage

First, install the editor withnpm:

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

Then import the editor 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.see source

PropsDescriptionRequired
editorStatesee here*
onChangesee here*
pluginsan array of plugins
decoratorsan array of custom decorators
defaultKeyBindingsbool
defaultBlockRenderMapbool
all other props accepted by the DraftJS Editor except decoratorsee 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}/>);}}

How to write a Plugin

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!

Discussion and Support

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

Development

Check out ourContribution Guide.

Learn about why Draft.js and how to use DraftJS Plugins

In this talk Nik Graf explained the ContentState structure of a Draft.js Editor as well as explained how to use plugins.

License

MIT

About

React Plugin Architecture for Draft.js including Slack-Like Emojis, FB-Like Mentions and Stickers

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors205


[8]ページ先頭

©2009-2025 Movatter.jp