0.2.0 • Published 5 years ago

@deskpro/fa-picker v0.2.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
5 years ago

Installation

npm install --save emoji-mart

Components

Picker

import 'icon-mart/css/icon-mart.css'
import { Picker } from 'emoji-mart'

<Picker set='emojione' />
<Picker onSelect={this.addIcon} />
<Picker title='Pick your icon…' icon='hand-point-up' />
<Picker style={{ position: 'absolute', bottom: '20px', right: '20px' }} />
<Picker i18n={{ search: 'Recherche', categories: { search: 'Résultats de recherche', recent: 'Récents' } }} />
PropRequiredDefaultDescription
autoFocusfalseAuto focus the search input when mounted
color#ae65c5The icon color
icondepartment_storeThe icon shown when no icons are hovered, set to an empty string to show nothing
include[]Only load included categories. Accepts I18n categories keys. Order will be respected, except for the recent category which will always be the first.
exclude[]Don't load excluded categories. Accepts I18n categories keys.
custom[]Custom icons
recentPass your own frequently used icons as array of string IDs
iconSize24The icon width and height
onClickParams: (icon, style, color, event) => {}. Not called when icon is selected with enter
onSelectParams: (icon, style, color) => {}
perLine9Number of icons per line. While there’s no minimum or maximum, this will affect the picker’s width. This will set Frequently Used length as well (perLine * 4)
i18n{…}An object containing localized strings
nativefalseRenders the native unicode icon
backgroundImageFn((set, sheetSize) => …)A Fn that returns that image sheet to use for icons. Useful for avoiding a request if you have the sheet locally.
iconsToShowFilter((icon) => true)A Fn to choose whether an icon should be displayed or not
showPreviewtrueDisplay preview section
showSkinTonestrueDisplay skin tones picker. Disable both this and showPreview to remove the footer entirely.
iconTooltipfalseShow icons short name when hovering (title)
styleInline styles applied to the root element. Useful for positioning
titleIcon Mart™The title shown when no icons are hovered
notFoundIconsleuth_or_spyThe icon shown when there are no search results
notFoundNot Found
icons{}Custom icons

I18n

search: 'Search',
clear: 'Clear', // Accessible label on "clear" button
notfound: 'No Icon Found',
colortext: 'Choose your color',
categories: {
  search: 'Search Results',
  recent: 'Frequently Used',
  custom: 'Custom',
},

Tip: You usually do not need to translate the categories and skin tones by youself, because this data and their translations should be included in the Unicode CLDR (the "Common Locale Data Repository"). You can look them up and just take them from there.

Examples of emoji object:

{
  id: 'smiley',
  name: 'Smiling Face with Open Mouth',
  colons: ':smiley:',
  text: ':)',
  emoticons: [
    '=)',
    '=-)'
  ],
  skin: null,
  native: '😃'
}

{
  id: 'santa',
  name: 'Father Christmas',
  colons: ':santa::skin-tone-3:',
  text: '',
  emoticons: [],
  skin: 3,
  native: '🎅🏼'
}

{
  id: 'octocat',
  name: 'Octocat',
  colons: ':octocat:',
  text: '',
  emoticons: [],
  custom: true,
  imageUrl: 'https://github.githubassets.com/images/icons/emoji/octocat.png'
}
0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago