Emoji Mart is a customizable
emoji picker HTML component for the web
Demo
Brought to you by the
Missive team
## π Table of Contents
- [πΎ Data](#-data)
- [πͺ Picker](#-picker)
- [π Emoji component](#-emoji-component)
- [π΅οΈββοΈ Headless search](#%EF%B8%8F%EF%B8%8F-headless-search)
- [π¬ Get emoji data from native](#-get-emoji-data-from-native)
- [πΊ Internationalization](#-internationalization)
- [π Examples](#-examples)
- [π€ Built for modern browsers](#-built-for-modern-browsers)
- [π Development](#-development)
## πΎ Data
Data required for the picker to work has been completely decoupled from the library. That gives developers the flexibility to better control their app bundle size and let them choose how and when this data is loaded. Data can be:
### Bundled directly into your codebase
- **Pros:** Picker renders instantly, data is available offline
- **Cons:** Slower initial page load (bigger file to load)
```sh
yarn add @emoji-mart/data
```
```js
import data from '@emoji-mart/data'
import { Picker } from 'emoji-mart'
new Picker({ data })
```
### Fetched remotely
- **Pros:** Data fetched only when needed, does not affect your app bundle size
- **Cons:** Network latency, doesnβt work offline (unless you configure a ServiceWorker)
```js
import { Picker } from 'emoji-mart'
new Picker({
data: async () => {
const response = await fetch(
'https://cdn.jsdelivr.net/npm/@emoji-mart/data',
)
return response.json()
}
})
```
In this example data is fetched from a content delivery network, but it could also be fetched from your own domain if you want to host the data.
## πͺ Picker
### React
```sh
npm install --save emoji-mart @emoji-mart/data @emoji-mart/react
```
```js
import data from '@emoji-mart/data'
import Picker from '@emoji-mart/react'
function App() {
return (