# draft-js-emoji-plugin

> Emoji Plugin for DraftJS

Latest version **2.1.3** (published 2019-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install draft-js-emoji-plugin
pnpm add draft-js-emoji-plugin
yarn add draft-js-emoji-plugin
bun add draft-js-emoji-plugin
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2019-08-21 |
| First published | 2016-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 124.6 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4084 |
| Author | Nik Graf |
| Maintainers | juliankrispel, nikgraf |
| Keywords | editor, wysiwyg, draft, react, ux, components, widget, react-component |

## Links

- npm: https://www.npmjs.com/package/draft-js-emoji-plugin
- Repository: https://github.com/draft-js-plugins/draft-js-plugins
- Homepage: https://github.com/draft-js-plugins/draft-js-plugins#readme
- Issues: https://github.com/draft-js-plugins/draft-js-plugins/issues
- npm.io page: https://npm.io/package/draft-js-emoji-plugin

## Dependencies (9)

- [clsx](https://npm.io/package/clsx.md) ^1.0.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.14
- [emojione](https://npm.io/package/emojione.md) ^2.2.7
- [to-style](https://npm.io/package/to-style.md) ^1.3.3
- [immutable](https://npm.io/package/immutable.md) ~3.7.4
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.8
- [react-icons](https://npm.io/package/react-icons.md) ^2.2.6
- [find-with-regex](https://npm.io/package/find-with-regex.md) ^1.1.3
- [react-custom-scrollbars](https://npm.io/package/react-custom-scrollbars.md) ^4.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.1.3 (latest) — 2019-08-21
- 2.0.0 (beta) — 2017-11-09
- 2.1.2 — 2019-08-21
- 2.1.1 — 2018-09-04
- 2.1.0 — 2018-09-03
- 2.0.6 — 2018-04-26
- 2.0.5 — 2018-04-25
- 2.0.4 — 2018-04-25
- 2.0.3 — 2018-04-25
- 2.0.2 — 2018-03-29
- 2.0.1 — 2017-11-09
- 2.0.0-rc10 — 2017-11-07
- 2.0.0-rc9 — 2017-09-25
- 2.0.0-rc8 — 2017-09-21
- 2.0.0-rc7 — 2017-09-13
- … 28 more at https://npm.io/package/draft-js-emoji-plugin/versions

## README

# DraftJS Emoji Plugin

*This is a plugin for the `draft-js-plugins-editor`.*

This plugin provides consistent Emoji display across all platforms, independent of the host system.

## Usage

```js
import createEmojiPlugin from 'draft-js-emoji-plugin';

const emojiPlugin = createEmojiPlugin();
```
## Advanced Usage

```js
const emojiPlugin = createEmojiPlugin({
  priorityList: {
    ':see_no_evil:': ["1f648"],
    ':raised_hands:': ["1f64c"],
    ':100:': ["1f4af"],
  }
});
// emojis in priorityList will show up after user typed ':'
```
## Importing the default styles

The plugin ships with a default styling available at this location in the installed package:
`node_modules/draft-js-emoji-plugin/lib/plugin.css`.

### Webpack Usage

Follow the below steps to import the css file by using Webpack's `style-loader` and `css-loader`. 

1. Install Webpack loaders: `npm install style-loader css-loader --save-dev`
2. Add the below section to Webpack config (if your Webpack already has loaders array, simply add the below loader object(`{test:foo, loaders:bar[]}`) as an item in the array).

    ```js
    module: {
      loaders: [{
        test: /\.css$/,
        loaders: [
          'style-loader', 'css'
        ]
      }]
    }
    ```

3. Add the below import line to your component to tell Webpack to inject style to your component.

    ```js
    import 'draft-js-emoji-plugin/lib/plugin.css';
    ```
4. Restart Webpack.

---
_Source: https://npm.io/package/draft-js-emoji-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
