Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 628 Bytes

README.md

File metadata and controls

40 lines (32 loc) · 628 Bytes

React IconPicker

Forked from https://www.npmjs.com/package/react-icon-picker for bugfix

Usage

import * as React from 'react';
import IconPicker from 'react-icon-picker';

const icons = [
  'fas fa-camera',
  'fas fa-fish',
  'fas fa-align-center',
  'fas fa-align-justify'
];

const App = () => {

  const [state, setState] = React.useState({
    icon: ''
  });

  return (<>
    <span className={state.icon}></span>
    <IconPicker 
      icons={icons} 
      defaultValue="fas fa-camera" 
      onChange={(icon) => {
        setState({
          ...state,
          icon
        })
      }}
    />
  </>);
}