Skip to content

Latest commit

 

History

History
90 lines (76 loc) · 4.08 KB

quickstart.mdx

File metadata and controls

90 lines (76 loc) · 4.08 KB
title description
Quickstart
Start building awesome documentation in under 5 minutes

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

You can get it on npm.

npm install react-input-emoji --save

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"
    />
  )
}

Internationalization

The react-input-emoji library is dedicated to enhancing the global user experience, catering to a broad spectrum of users from various linguistic backgrounds.

- Arabic (ar) - Belarusian (be) - Czech (cs) - German (de) - English (en) - Spanish (es) - Persian (fa) - Finnish (fi) - French (fr) - Hindi (hi) - Italian (it) - Japanese (ja) - Korean (kr) - Polish (pl) - Portuguese (pt) - Russian (ru) - Sanskrit (sa) - Turkish (tr) - Ukrainian (uk) - Vietnamese (vi) - Chinese (zh)

Props

The border color of the input container. The border radius of the input container. An HTMLElement that, when clicked, triggers the emoji picker. If this prop is provided, the default emoji picker button is removed. A React mutable ref object that, when referenced, triggers the emoji picker. If this prop is provided, the default emoji picker button is removed. Clean the input value after the keydown event. The font size of the placeholder and input container. The font family of the placeholder and input container. The total height of the area in which the element is rendered. If set to true, the emoji picker will remain open after selecting an emoji. default="false. Set the language of the emoji picker. The maximum number of characters allowed in the element. This function is called when the value of the input changes. The first argument is the current value. This function is called when the input is clicked. This function is called after the keydown event is fired with the keyCode === 13 returning the last value. This function is called when the input has received focus. This function is called when the width or the height of the input changes. The first argument is the current size value. Set the placeholder of the input. Allows the user to use the Shift + Enter or Ctrl + Enter keyboard shortcut to create a new line. The input value.