diff --git a/README.md b/README.md index e3886017c1..e477d90d5c 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,34 @@ # fluentui-emoji-js ### A JavaScript wrapper for Microsoft's [Fluent Emojis](https://github.com/microsoft/fluentui-emoji). -[View on NPM](https://www.npmjs.com/package/fluentui-emoji-js) | [View Live Demo](https://fluentui-emoji-js-demo.netlify.app) +NPM | +Github | +Live Demo -![Fluent Emoji](art/readme_banner.webp) - -## Usage -### Install +## Install ```bash npm install fluentui-emoji-js ``` -### Import +## Usage +### Common JS ```js const emoji = require('fluentui-emoji-js') -// or -import * as emoji from 'fluentui-emoji-js' -``` - -### Examples -#### Common JS -```cjs -const emoji = require('fluentui-emoji-js') emoji.fromGlyph('👋','3D').then((emojiFile) => { console.log(emojiFile) }) ``` -#### ES Module -```mjs +### ES Module +```js import * as emoji from 'fluentui-emoji-js' const emojiFile = await emoji.fromGlyph('👋','3D') console.log(emojiFile) ``` -## Displaying the emoji +### 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