{"id":13533329,"url":"https://github.com/LXSMNSYC/solid-emoji-picker","last_synced_at":"2025-04-01T21:32:13.346Z","repository":{"id":57140781,"uuid":"433899866","full_name":"lxsmnsyc/solid-emoji-picker","owner":"lxsmnsyc","description":"Unstyled emoji picker for SolidJS","archived":false,"fork":false,"pushed_at":"2024-04-16T05:23:29.000Z","size":621,"stargazers_count":32,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T08:01:33.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lxsmnsyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-01T16:20:40.000Z","updated_at":"2025-03-20T16:24:46.000Z","dependencies_parsed_at":"2024-10-20T15:51:52.105Z","dependency_job_id":null,"html_url":"https://github.com/lxsmnsyc/solid-emoji-picker","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"416697aec30a3a362efe7d9b8a3078e38afefaeb"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxsmnsyc%2Fsolid-emoji-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxsmnsyc%2Fsolid-emoji-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxsmnsyc%2Fsolid-emoji-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxsmnsyc%2Fsolid-emoji-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lxsmnsyc","download_url":"https://codeload.github.com/lxsmnsyc/solid-emoji-picker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246713346,"owners_count":20821876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:18.766Z","updated_at":"2025-04-01T21:32:12.714Z","avatar_url":"https://github.com/lxsmnsyc.png","language":"TypeScript","funding_links":[],"categories":["📦 Components \u0026 Libraries"],"sub_categories":["Misc."],"readme":"# solid-emoji-picker\n\n\u003e Unstyled Emoji Picker component for SolidJS\n\n[![NPM](https://img.shields.io/npm/v/solid-emoji-picker.svg)](https://www.npmjs.com/package/solid-emoji-picker) [![JavaScript Style Guide](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript) [![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat-square\u0026logo=codesandbox)](https://codesandbox.io/s/github/LXSMNSYC/solid-emoji-picker/tree/main/examples/demo)\n\n## Install\n\n```bash\nnpm i solid-emoji-picker\n```\n\n```bash\nyarn add solid-emoji-picker\n```\n\n```bash\npnpm add solid-emoji-picker\n```\n\n## Usage\n\n### Simplest example\n\n```jsx\nimport { EmojiPicker } from 'solid-emoji-picker';\n\nfunction App() {\n  function pickEmoji(emoji) {\n    console.log('You clicked', emoji.name);\n  }\n\n  return (\n    \u003cEmojiPicker onEmojiClick={pickEmoji} /\u003e\n  );\n}\n```\n\n### Emoji Data\n\nThe emoji data is based on [`unicode-emoji-json`](https://github.com/muan/unicode-emoji-json).\n\n### Events\n\nAll event properties receives the emoji item data and the accompanying event value.\n\n- `onEmojiClick` - `\"click\"` event\n- `onEmojiFocus` - `\"focus\"` event\n- `onEmojiHover` - `\"mouseover\"` event\n\n### Styling\n\nThe emoji picker has the following structure:\n\n```html\n\u003cdiv class=\"emoji-picker\"\u003e\n  \u003cdiv class=\"emoji-section\"\u003e\n    \u003cspan class=\"emoji-section-title\"\u003e\u003c/span\u003e\n    \u003cdiv class=\"emoji-items\"\u003e\n      \u003cbutton class=\"emoji-button\"\u003e\n        \u003c!-- user-defined --\u003e\n      \u003c/button\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\nYou can refer to these classes for styling the parts of the emoji picker.\n\n### Skin Tones\n\nYou can define your selected skin tone with the `skinTone` property for `EmojiPicker`. The `skinTone` property has the following possible values: `\"light\"`, `\"medium-light\"`, `\"medium\"`, `\"medium-dark\"` and `\"dark\"`. By default, it is `undefined`.\n\n```jsx\n\u003cEmojiPicker skinTone=\"medium\" /\u003e\n```\n\nTake note that some emojis might not correctly apply the skin tone, this depends on the emoji support.\n\n### Filtering\n\n`filter` allows conditionally rendering each emoji item. `filter` receives the emoji item data which shall then return a boolean. This is useful for emulating emoji search.\n\n```jsx\n\u003cEmojiPicker filter={(emoji) =\u003e emoji.name.includes('hand')} /\u003e\n```\n\n### Custom rendering\n\n`renderEmoji` allows emoji to be rendered in a user-defined way. `renderEmoji` receives the emoji item data, the components (used for skin tone reference) and the currently selected skin tone, in which `renderEmoji` must return a `JSX.Element`.\n\nHere's an example with [`twemoji`](https://github.com/twitter/twemoji):\n\n```jsx\nimport twemoji from 'twemoji';\nimport {\n  convertSkinToneToComponent,\n  getEmojiWithSkinTone,\n} from 'solid-emoji-picker';\n\nfunction getTwemoji(\n  emojis,\n  emoji,\n  components,\n  tone,\n) {\n  const skinTone = convertSkinToneToComponent(components, tone);\n  const tonedEmoji = getEmojiWithSkinTone(emojis, emoji, skinTone);\n  return twemoji.parse(tonedEmoji);\n}\n\nfunction renderTwemoji(\n  emojis,\n  emoji,\n  components,\n  tone,\n) {\n  return \u003cspan innerHTML={getTwemoji(emojis, emoji, components, tone)} /\u003e;\n}\n\n\u003cEmojiPicker renderEmoji={renderTwemoji} /\u003e\n```\n\nIf `renderEmoji` is unspecified, it renders the following:\n\n```jsx\n\u003cspan class=\"emoji\"\u003e{emojiCodeWithSkinTone}\u003c/span\u003e\n```\n\n\u003e [!WARNING]\n\u003e As of April 2024, twemoji no longer works as their CDN is no longer maintained.\n\n### Custom CDN\n\nBy default, `solid-emoji-picker` loads the emoji data from `unicode-emoji-json`'s UNPKG. You can use the following to modify the data handling:\n\n- `setCDN` - sets the base CDN path, defaults to `\"https://unpkg.com/unicode-emoji-json/\"`\n- `setEmojiURL` - specify the full path of the emoji data JSON. If not set, it defaults to selected CDN path + `\"data-by-emoji.json\"`.\n- `setGroupURL` - specify the full path of the group data JSON. If not set, it defaults to selected CDN path + `\"data-by-group.json\"`.\n- `setComponentsURL` - specify the full path of the component JSON. If not set, it defaults to selected CDN path + `\"data-emoji-components.json\"`.\n- `loadEmojiData` - Fetch the emoji data.\n- `loadEmojiComponents` - Fetch the components data.\n- `loadEmojiGroupData` - Fetch the emoji group data.\n- `setEmojiData` - Set the emoji data.\n- `setEmojiComponents` - Set the components data.\n- `setEmojiGroupData` - Set the emoji group data.\n\n### Suspense\n\n`\u003cEmojiPicker\u003e` uses `createResource` for data fetching. Wrapping it in `\u003cSuspense\u003e` is recommended.\n\nTo directly access these resource primitives, you can use `useEmojiData`, `useEmojiGroupData` and `useEmojiComponents`, both returns the data resource.\n\n## Sponsors\n\n![Sponsors](https://github.com/lxsmnsyc/sponsors/blob/main/sponsors.svg?raw=true)\n\n## License\n\nMIT © [lxsmnsyc](https://github.com/lxsmnsyc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLXSMNSYC%2Fsolid-emoji-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLXSMNSYC%2Fsolid-emoji-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLXSMNSYC%2Fsolid-emoji-picker/lists"}