Socket
Socket
Sign inDemoInstall

emoji-picker-react

Package Overview
Dependencies
Maintainers
1
Versions
285
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emoji-picker-react

Emoji Picker component for React Applications on the web


Version published
Weekly downloads
244K
decreased by-4.13%
Maintainers
1
Weekly downloads
ย 
Created

What is emoji-picker-react?

emoji-picker-react is a React component library that provides an easy-to-use emoji picker. It allows developers to integrate an emoji selection interface into their React applications, making it simple for users to select and use emojis.

What are emoji-picker-react's main functionalities?

Basic Emoji Picker

This code demonstrates how to integrate a basic emoji picker into a React application. When an emoji is selected, it updates the state and displays the chosen emoji.

import React, { useState } from 'react';
import EmojiPicker from 'emoji-picker-react';

const App = () => {
  const [chosenEmoji, setChosenEmoji] = useState(null);

  const onEmojiClick = (event, emojiObject) => {
    setChosenEmoji(emojiObject);
  };

  return (
    <div>
      <h1>Emoji Picker</h1>
      <EmojiPicker onEmojiClick={onEmojiClick} />
      {chosenEmoji && <p>You chose: {chosenEmoji.emoji}</p>}
    </div>
  );
};

export default App;

Customizing Emoji Picker

This example shows how to customize the emoji picker by disabling auto-focus and changing the location of the skin tone picker.

import React, { useState } from 'react';
import EmojiPicker from 'emoji-picker-react';

const App = () => {
  const [chosenEmoji, setChosenEmoji] = useState(null);

  const onEmojiClick = (event, emojiObject) => {
    setChosenEmoji(emojiObject);
  };

  return (
    <div>
      <h1>Custom Emoji Picker</h1>
      <EmojiPicker onEmojiClick={onEmojiClick} disableAutoFocus={true} skinTonePickerLocation='SEARCH' />
      {chosenEmoji && <p>You chose: {chosenEmoji.emoji}</p>}
    </div>
  );
};

export default App;

Emoji Search

This code demonstrates how to add a search functionality to the emoji picker, allowing users to search for specific emojis.

import React, { useState } from 'react';
import EmojiPicker from 'emoji-picker-react';

const App = () => {
  const [chosenEmoji, setChosenEmoji] = useState(null);

  const onEmojiClick = (event, emojiObject) => {
    setChosenEmoji(emojiObject);
  };

  return (
    <div>
      <h1>Emoji Picker with Search</h1>
      <EmojiPicker onEmojiClick={onEmojiClick} searchPlaceholder='Search for an emoji...' />
      {chosenEmoji && <p>You chose: {chosenEmoji.emoji}</p>}
    </div>
  );
};

export default App;

Other packages similar to emoji-picker-react

Keywords

FAQs

Package last updated on 02 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc