Emoji plugin for last-draft
npm install ld-emoji --save
import {Editor} from 'last-draft'
import emoji from 'ld-emoji'
let plugins = [emoji]
export default class ExampleEditor extends Component {
constructor(props) {
super(props)
const INITIAL_STATE = editorStateFromHtml('<div></div>')
this.state = { value: INITIAL_STATE }
}
onChange(editorState) {
this.setState({ value: editorState })
}
render() {
return (
<Editor
inline={['bold', 'italic', 'code', 'dropcap']}
blocks={['h2', 'quote']}
plugins={plugins}
editorState={this.state.value}
onChange={::this.onChange} />
)
}
}
Last Draft plugins use styled-components 💅 for the base styling.
You can also add custom css to override the base styling with the following class names specified below:
.emoji-modal-wrapper {}
.emoji-button {}
.ld-emoji-wrapper {}
.ld-emoji {}
.ld-emoji-list {}
.ld-emoji-autocomplete {}
.ld-emoji-menu {}
.ld-emoji-menu-list {}
.ld-emoji-item {}
.ld-emoji-character {}
.ld-emoji-picker-wrapper-outer {}
.ld-emoji-picker-wrapper {}
.ld-emoji-picker-item {}
.ld-emoji-button-close-wrapper {}
.ld-emoji-button-close {}
.emoji-picker-tabs {}
.emoji-picker-tab-title {}