Skip to content

Commit

Permalink
Add to README.md for support of spritesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
Kennybll committed Nov 30, 2018
1 parent 94baec1 commit 2ff225b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Following the `dangerouslySetInnerHTML` example above, make sure the wrapping `s
```

## Custom emojis
You can provide custom emojis which will show up in their own category.
You can provide custom emojis which will show up in their own category. You can either use a single image as imageUrl or use a spritesheet as shown in the second object.

```js
import { Picker } from 'emoji-mart'
Expand All @@ -234,6 +234,19 @@ const customEmojis = [
keywords: ['github'],
imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/octocat.png?v7'
},
{
name: 'Test Flag',
short_names: ['test'],
text: '',
emoticons: [],
keywords: ['test', 'flag'],
spriteUrl: 'https://unpkg.com/[email protected]/img/twitter/sheets-256/64.png',
sheet_x: 1,
sheet_y: 1,
size: 64,
sheetColumns: 52,
sheetRows: 52,
},
]

<Picker custom={customEmojis} />
Expand Down

0 comments on commit 2ff225b

Please sign in to comment.