import { Layout } from '@/layout';
import { MDX_DATA } from '@/mdx';
export default Layout(MDX_DATA.GettingStartedEmoji);
## Installation
After installation import package styles at the root of your application:
```tsx
import '@mantine/core/styles.css';
// ‼️ import emoji styles after core package styles
import '@mantine/emoji/styles.css';
```
## Emoji data
`@mantine/emoji` does not include emoji data, you need to pass it with the `data` prop.
The package exports adapters for the two most popular emoji data sources:
### Using @emoji-mart/data
Install the data package:
Then use the adapter to convert the data:
```tsx
import data from '@emoji-mart/data';
import { emojiMartAdapter, EmojiPicker } from '@mantine/emoji';
const emojiData = emojiMartAdapter(data);
function Demo() {
return ;
}
```
### Using emojibase-data
Install the data package:
Then use the adapter to convert the data:
```tsx
import data from 'emojibase-data/en/data.json';
import messages from 'emojibase-data/en/messages.json';
import { emojibaseAdapter, EmojiPicker } from '@mantine/emoji';
const emojiData = emojibaseAdapter(data, messages);
function Demo() {
return ;
}
```
### Custom data
You can also provide data directly using the `EmojiPickerData` interface:
```tsx
import { EmojiPicker, EmojiPickerData } from '@mantine/emoji';
const data: EmojiPickerData = {
categories: [
{ id: 'people', label: 'Smileys & People', emojis: ['grinning', 'wave'] },
],
emojis: {
grinning: {
id: 'grinning',
name: 'Grinning Face',
keywords: ['happy', 'smile'],
emoji: '😀',
},
wave: {
id: 'wave',
name: 'Waving Hand',
keywords: ['hello', 'hi'],
emoji: '👋',
skins: ['👋🏻', '👋🏼', '👋🏽', '👋🏾', '👋🏿'],
},
},
};
function Demo() {
return ;
}
```
## Canonical category IDs
Both adapters return the same category IDs in the following order. Use these IDs
as keys of the `categoryLabels` prop:
- `people` – Smileys & People
- `nature` – Animals & Nature
- `foods` – Food & Drink
- `activity` – Activity
- `places` – Travel & Places
- `objects` – Objects
- `symbols` – Symbols
- `flags` – Flags
`frequent` category is not returned by the adapters. To display recently used emojis,
add a category with `id: 'frequent'` to your data. It is displayed with a clock icon
in the category navigation.