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

icon-delivery

v1.0.4

Published

Icon delivery network

Downloads

43

Readme

Icon Delivery System

Description

The Icon Delivery System is a lightweight package designed to provide developers with dynamic SVG icons based on a requested name. It offers an easy and efficient way to integrate SVG icons into React applications by fetching them based on specific identifiers. This system allows for scalable vector graphics that can be embedded directly into your components, maintaining flexibility and responsiveness in your UI.

Table of Contents

Installation

To use the Icon Delivery System in your project, follow these steps:

  1. Install the Package:
     npm install icon-delivery

OR

  1. Clone the Repository:

    git clone https://github.com/username/icon-delivery.git
  2. Navigate to the Project Directory:

    cd icon-delivery
  3. Install Dependencies:

    npm install
  4. Start the Development Server: To run the package locally, use the development server:

    npm start

You are now ready to use the Icon Delivery System in your React project.

Usage

Once the package is installed and running, you can integrate it into your project by using the provided functions and components.

Fetching Icons by Name

You can fetch SVG icons dynamically by calling the getIconByName function with the icon's name:

import { getIconByName } from 'icon-delivery';

async function fetchIcon() {
    const icon = await getIconByName('React');
    console.log(icon); // Logs the SVG for the React icon
}

OR

import { getIconByName } from './src/index';

async function fetchIcon() {
    const icon = await getIconByName('React');
    console.log(icon); // Logs the SVG for the React icon
}

Using the DynamicIcon Component

For easier integration into your UI, you can also use the DynamicIcon component, which renders the SVG icon based on the iconName prop.

import { DynamicIcon } from 'icon-delivery';

const App = () => {
    return (
        <div>
            <h1>Welcome to the Icon Delivery System</h1>
            <DynamicIcon iconName="React" />
        </div>
    );
};

export default App;

OR

import { DynamicIcon } from './components/DynamicIcon';

const App = () => {
    return (
        <div>
            <h1>Welcome to the Icon Delivery System</h1>
            <DynamicIcon iconName="React" />
        </div>
    );
};

export default App;

This will dynamically render the requested icons in your React application.

Features

  • Dynamic Icon Fetching: Fetch SVG icons dynamically based on the provided name.
  • React Component Integration: A simple DynamicIcon component to integrate SVGs into your app.
  • Lightweight: Optimized for performance and minimal overhead.
  • Scalable: SVGs are scalable and responsive, perfect for modern web applications.

Screenshots

Here is a screenshot of the DynamicIcon component in action:

Add screenshot here

Contributing

We welcome contributions to the Icon Delivery System! If you would like to contribute, please follow these steps:

  1. Fork the repository on GitHub.
  2. Clone your forked repository locally:
    git clone https://github.com/yourusername/icon-delivery.git
  3. Create a new branch for your feature:
    git checkout -b feature-branch
  4. Make your changes and commit them:
    git commit -m "Add new feature"
  5. Push your changes to your branch:
    git push origin feature-branch
  6. Open a Pull Request on GitHub, and we will review it as soon as possible.

License

This project is licensed under the MIT License - see the LICENSE file for details.