GithubHelp home page GithubHelp logo

grigary-c-antony / react-input-emoji Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cesarwbr/react-input-emoji

0.0 0.0 0.0 8.65 MB

A React input with an option to pick emojis ๐Ÿ˜ ๐Ÿ˜œ ๐Ÿ˜‚ ๐Ÿ˜›

Home Page: https://cesarwbr.github.io/react-input-emoji/

License: MIT License

JavaScript 92.76% CSS 5.47% HTML 1.76%

react-input-emoji's Introduction

react-input-emoji

A React input with an option to pick emojis

NPM JavaScript Style Guide

Demo

About

InputEmoji provides a simple way to have an input element with emoji picker support. Click the picker button next to the input field and select an emoji from the popup window. Done!

Install

npm install --save react-input-emoji

Usage

After install import the react-input-emoji component to display your input with emoji support like so:

import React, { useState } from "react";
import InputEmoji from "react-input-emoji";

export default function Example() {
  const [text, setText] = useState("");

  function handleOnEnter(text) {
    console.log("enter", text);
  }

  return (
    <InputEmoji
      value={text}
      onChange={setText}
      cleanOnEnter
      onEnter={handleOnEnter}
      placeholder="Type a message"
    />
  );
}

Props

Prop Type Default Description
value string "" The input value.
onChange function - This function is called when the value of the input changes. The first argument is the current value.
onResize function - This function is called when the width or the height of the input changes. The first argument is the current size value.
onClick function - This function is called when the input is clicked.
onFocus function - This function is called when the input has received focus.
cleanOnEnter boolean false Clean the input value after the keydown event.
onEnter function - This function is called after the keydown event is fired with the keyCode === 13 returning the last value.
placeholder string "Type a message" Set the placeholder of the input.
height number 40 The total height of the area in which the element is rendered.
maxLength number - The maximum number of characters allowed in the element.
theme string - Set theme for emoji popup. Available values "light", "dark", "auto"
borderRadius number 21 The border radius of the input container.
borderColor string "#EAEAEA" The border color of the input container.
fontSize number 15 The font size of the placeholder and input container.
fontFamily string "sans-serif" The font family of the placeholder and input container.

License

MIT ยฉ cesarwbr

react-input-emoji's People

Contributors

cesarwbr avatar arielvieira avatar artexoid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.