npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-react-icons

v0.2.1

Published

A plugin for strapi to select react icons.

Downloads

11

Readme

Strapi Plugin React Icons

A plugin for Strapi v4 that gives users a custom field and search bar for the library react-icons.

Installation

Step 1: Install with package manager of your choice.

Install strapi-react-icons with yarn or npm:

  • Install with yarn:
  yarn add strapi-react-icons
  • Install with npm:
  npm i strapi-react-icons

Step 2: Rebuild your Strapi Admin Panel:

  • Rebuild with yarn:
  yarn build
  • Rebuild with npm:
  npm run build

Screenshot Guide

Step 1:

Navigate to the strapi-react-icons settings page (Shown in the screenshot below):

1

Step 2:

Click the button that says "Import default icon libraries" to import the icons:

  • The functionality to disable/enable select libraries is not implemented yet, so leave the checkboxes as-is.
  • You will be able to filter the libraries, somewhat, when interacting with the field.

2

Step 3:

In your Content-Type Builder, press the Add new field button. Navigate to the tab that says CUSTOM and click on the field labelled, react-icon.

Press Save to save to restart your Strapi server.

3

Step 4:

Navigate to your select Content Type that you just created and click on the search icon to bring up an icon search modal.

4

By default, all icon libraries are (lazily) loaded.

5

Step 5:

In order to find the icons you want, you can either search for the keyword using the search bar, or you can filter the icons shown using the select menu in the bottem left hand side of the modal.

No Filtering, searching for a briefcase icon.

6

Filtering to only show Font Awesome 5 Icons (fa5), searching for a briefcase icon.

7

Step 6:

Click on the icon that best suits your needs, it should populate the custom field.

Finally, press Save to save your changes and Publish to publish them. Enjoy!

8

Usage/Examples

In Strapi v4

  • Select your prefered icon libraries on the settings page.
  • Add react-icon as custom field to your content type.
  • Press the search icon to select a icon from any of the selected icon libraries.

In React / Next.js

Create the following IconComponent to dynamically show the icon:

import * as ReactIcons from "react-icons/all";

interface IIconComponent {
  icon: string;
  size?: number;
}

type IReactIcon = keyof typeof ReactIcons;

const IconComponent: React.FC<IIconComponent> = ({ icon, size }) => {
  const DynamicIconComponent = ReactIcons[icon as IReactIcon];

  if (undefined === DynamicIconComponent) return <></>;

  return <DynamicIconComponent size={size} />;
};

Roadmap

  • Add a default All Libraries option to the modal.

  • Fix varying bugs.

Authors

Contributers