0.4.10 • Published 1 year ago

react-character-map v0.4.10

Weekly downloads
34
License
MIT
Repository
github
Last release
1 year ago

React Character Map

Include a character map in your app using our React Character Map.

It provides a simple interface for users to select a character from a list of categorised characters.

Installation

npm install react-character-map

or

yarn add react-character-map

Usage

// Import the module into your react app
import {CharacterMap} from 'react-character-map';
// Use the element;
<CharacterMap
	characterData={optionalCustomCharacterData}
	onSelect={function(char,el){ console.log(char, el); }}
/>

Properties

  • autofocus (boolean): When autofocus is true, the component's search input will be focused on mount. Default: true.

  • characterData is an optional property that overrides the default character map. characterData should be provided in the form:

{
    "TAB NAME": [
        { "entity": "&copy;", "hex": "&#00A9;", "name": "COPYRIGHT SIGN", "char": "©" } // char is required
    ],
    "ANOTHER TAB": [
        { MORE CHARACTER DATA }
    ]
}
  • onSelect callback: This is fired when the user clicks on a character, and has two parameters;
onSelect(char, el)

char is an Object of the character that has been selected, for instance;

{ "hex": "&#263B;", "name": "BLACK SMILING FACE", "char": "☻" }

or

{ "char":"ø" }

The second parameter el is the element that has been selected, this is an anchor.

<button data-hex="&#00D8;" data-entity="&Oslash;" data-char="Ø" data-title="LATIN CAPITAL LETTER O WITH STROKE">Ø</button>

Styling

The package comes with very basic styling, it is recommended that you style it to match your app.

npm.io

Thanks

Thank you to the contributors for actively improving and making suggestions to the repo.

https://github.com/Dayjo/react-character-map/graphs/contributors

  • @adamsilverstein
  • @jeffpaul
0.4.10

1 year ago

0.4.9

1 year ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.5

2 years ago

0.4.6

2 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

4 years ago

0.2.2

5 years ago

0.2.0

5 years ago

0.1.10

5 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.0

6 years ago