diff --git a/README.md b/README.md index 3c1e92e519..e3886017c1 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,19 @@ const emojiFile = await emoji.fromGlyph('👋','3D') console.log(emojiFile) ``` +## Displaying the emoji +Both `fromGlyph(glyph, style)` and `fromCode(code, style)` return the location of the emoji image relative to the base emoji folder. You can download the assets folder from the [fluentui-emoji repo](https://github.com/microsoft/fluentui-emoji) or use a service like [jsdelivr](https://jsdelivr.com) to get the emoji image. + +#### Getting emoji image via jsdelivr +```js +const emojiImage = document.querySelector('#emojiImage'); +const emoji = '🍕'; + +emoji.fromGlyph(emoji,'3D').then((emojiFile) => { + emojiImage.src = `https://cdn.jsdelivr.net/gh/microsoft/fluentui-emoji@latest/assets${emojiFile}` +}) +``` + ### More Info fluentui-emoji-js has 2 main functions `fromGlyph(glyph, style)` and `fromCode(code, style)`. Both return the location of the emoji image relative to the base emoji folder. diff --git a/package.json b/package.json index 04b1220fa4..cac44d4f86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fluentui-emoji-js", - "version": "1.0.1", + "version": "1.1.0", "description": "A JavaScript wrapper for Microsoft's Fluent Emojis", "main": "index.cjs", "scripts": {