react-simple-emoji
A simple emoji picker component. 😉
Install
$ npm install react-simple-emoji
How to Use
If you have main component, and you want to add emoji picker:
;; { super; thisstate = text: '' showSelector: false ; thishandleEmoji = thishandleEmoji; thisselectEmoji = thisselectEmoji; thishandleInputChange = thishandleInputChange; thishandleKeyDown = thishandleKeyDown; } { this; } { const text = etargetvalue; this; } { if ekeyCode === 13 return this; } { const inpuText = thisstatetext; this; } { return <div> <input value=thisstatetext type="text" onChange=thishandleInputChange onKeyDown=thishandleKeyDown /> <EmojiPicker show=thisstateshowSelector selector=thisselectEmoji handleEmoji=thishandleEmoji /> </div> ; }
API
props
show
Required Type: boolean
Showing emoji picker state.
selector
Required Type: function
Change emoji picker showing state.
handleEmoji
Required Type: function
Handle input text and emoji.
emojiSearchInputStyle
Type: object
Custom your emoji search input style.
selectorStyle
Type: object
Custom your selector box style.
Test
$ npm test
Lint
$ npm run lint
LICENSE
MIT © Peng Jie