Socket
Book a DemoInstallSign in
Socket

@deskpro/fa-picker

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deskpro/fa-picker

Customizable Slack-like font awesome icon picker for React based on emoji-mart

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
4
Created
Source

Fa Picker is a Slack-like customizable
font awesome icon picker component for React
DemoChangelog

Build Status

picker
Brought to you by the Deskpro team



Heavy thanks to Missive team for Emoji-mart

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'
}

Keywords

react

FAQs

Package last updated on 09 Oct 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.