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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@infinilabs/custom-icons

v0.0.4

Published

Configurable icon components and picker for lucide-react

Readme

@infinilabs/custom-icons

Icon components based on lucide-react. It provides two core parts: configuration (IconPicker) and rendering (ConfigurableIcon).

Install

pnpm add @infinilabs/custom-icons lucide-react react react-dom

react, react-dom, and lucide-react are peer dependencies.

Rendering (ConfigurableIcon)

import { ConfigurableIcon } from "@infinilabs/custom-icons";

export default function Example() {
  return (
    <ConfigurableIcon type="lucide" name="Bot" color="#0287FF" size={24} />
  );
}

Props

  • type: lucide | custom
  • name: lucide-react icon name (auto-normalized, e.g. "bot" or "Bot")
  • color: color (default #0287FF)
  • size: size in px (default 24)
  • dataUrl: data: URL for custom images (when type=custom)

Configuration (IconPicker)

Pick icons from lucide-react and preview instantly.

import { IconPicker } from "@infinilabs/custom-icons";

function PickerDemo() {
  const [config, setConfig] = useState({ type: "lucide", name: "Bot", color: "#0287FF", size: 24 });
  return <IconPicker initial={config} onChange={setConfig} />;
}

Props

  • initial: initial configuration (optional)
  • onChange(config): callback on every change (optional)
  • showList: show datalist name suggestions (default true)
  • configurable: show configuration panel (default true)
  • controls: fine-grained visibility control (optional)
  • theme: 'light' | 'dark' | 'auto' (default auto)
  • i18n: override labels { typeLabel, nameLabel, uploadLabel, sizeLabel, colorLabel, notFound }
  • locale: language code such as zh-CN or en-US (takes precedence over browser language)

controls structure

type IconPickerControls = {
  type: boolean;   // icon type (lucide/custom)
  name: boolean;   // lucide icon name input
  size: boolean;   // size in px
  color: boolean;  // color input
  upload: boolean; // custom image upload
}

Theme & i18n examples

<IconPicker initial={config} theme="light" locale="zh-CN" />
<IconPicker initial={config} theme="dark" locale="zh-CN" />
<IconPicker initial={config} theme="auto" locale="en-US" />

// override English labels
<IconPicker
  initial={config}
  theme="auto"
  locale="en-US"
  i18n={{
    typeLabel: "Icon type",
    nameLabel: "Pick lucide icon",
    uploadLabel: "Upload image",
    sizeLabel: "Size(px)",
    colorLabel: "Color",
  }}
/>

Custom image mode

<IconPicker
  initial={{ type: "custom", size: 24 }}
  controls={{ type: true, upload: true, size: true, color: true, name: false }}
/> 

Type Imports

When using TypeScript, import component values normally and import types with import type to keep type-only semantics.

import { IconPicker, ConfigurableIcon } from "@infinilabs/custom-icons";
import type { IconConfig, IconPickerControls, IconPickerI18n } from "@infinilabs/custom-icons";

const initial: IconConfig = {
  type: "lucide",
  name: "Bot",
  size: 28,
  color: "#1e90ff",
};

If you are in plain JavaScript and still want type hints, use JSDoc:

/** @type {import('@infinilabs/custom-icons').IconConfig} */
const initial = { type: 'lucide', name: 'Bot', size: 28, color: '#1e90ff' };