1.2.2 • Published 3 months ago

wordpress-icon-picker v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

WordPress Icon Picker

A simple and reusable Icon Picker component for WordPress & Gutenberg

Installation

The package can be installed via npm:

npm install wordpress-icon-picker --save

Or via yarn:

yarn add wordpress-icon-picker

You’ll need to install React inside your WordPress environment. In your react component where you want to show the iconpicker, add the code like below:

import { useState } from "@wordpress/element";
import {IconPicker} from "wordpress-icon-picker";
import "wordpress-icon-picker/dist/style.css"

const Example = () => {
  const [icon, setIcon] = useState('');
  return (
    <IconPicker
		    value={icon}
        icons = {IconList} //optional -- Array
        onChange={(value) =>
            setIcon(value)
        }
        title={"Select Icon"} //optional
        showHeading={true} //optional
        disableDashicon = {false} //optional
        disableFontAwesome = {false} //optional
    />
  );
};

To display Icon, add the code like below in your component.

import {DisplayIcon} from "wordpress-icon-picker";

const Example = () => {
  return (
    <DisplayIcon icon={icon} />
  );
};

To display icons, please ensure that FontAwesome 6.5 or a higher version is loaded.

License

Copyright (c) 2023 individual contributors. Licensed under MIT license, see LICENSE for the full license.

1.2.2

3 months ago

1.2.1

4 months ago

1.2.0

4 months ago

1.1.1

6 months ago

1.1.0

7 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.3

9 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago