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 🙏

© 2026 – Pkg Stats / Ryan Hefner

duo-icons

v2.0.1

Published

Duo Icons is a library of modern and beautiful duotone icons, designed for easy use in projects

Readme

[!IMPORTANT] ⚠️ Update Notice: Before migrating from version 1.x to the current version, we recommend reviewing the important changes and possible compatibility adjustments at this link:Version 2.x Changes

DuoIcons

Duo Icons is a library of modern and beautiful duotone icons, designed for easy use in web projects. It provides a collection of SVG icons that can be dynamically integrated into your HTML.

License

DuoIcons is totally free for commercial use and personal use, this software is licensed under the MIT License.

Installation

NPM

Install Duo Icons using npm for projects that use ES modules or bundlers like Vite, Webpack, etc.

npm install duo-icons

CDN

Include Duo Icons directly in your HTML using a CDN like Unpkg. This is useful for quick prototypes or projects without a bundler.

<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>My Project</title>
</head>
<body>
  <!-- Your content here -->

  <!-- Script Duo Icons -->
  <script src="https://unpkg.com/duo-icons@latest"></script>
</body>
</html>

Use

ES Module

If you installed via npm, import and use Duo Icons in your JavaScript/TypeScript files.

import * as DuoIcons from 'duo-icons';

// Initialize the icons in the document
DuoIcons.createIcons();

// Or in a specific container
DuoIcons.createIcons({
  root: '#my-container'
});

Unpkg (CDN)

After including the script in your HTML, access Duo Icons via window.DuoIcons.

<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>My Project</title>
</head>
<body>
  <div id="iconos">
    <i data-duo-icons="add-circle"></i>
    <i data-duo-icons="box"></i>
  </div>

  <script src="https://unpkg.com/duo-icons@latest"></script>
  <script>
    // Initialize the icons
    DuoIcons.createIcons();
  </script>
</body>
</html>

Function createIcons

The createIcons function is the core of Duo Icons. It searches the DOM for elements with specific attributes (such as data-duo-icons) and replaces them with the corresponding SVG icons from the library. This allows you to dynamically integrate icons without manually including SVGs in your HTML.

Options you receive

The function accepts an optional configuration object with the following properties:

  • icons (optional): A Record<string, string> object that allows you to define custom icons. Keys are the icon names, and values ​​are the SVG strings.

  • attributes (optional): A Record<string, any> object with additional attributes to apply to each generated SVG icon (e.g., CSS classes).

  • root (optional): An HTMLElement or a selector string (such as '#my-id' or '.my-class') that specifies the root element where to look for icons. If not provided, it uses document.

Modify the opacity and color of the inner layers.

Using the CSS classes duo-icons-secondary-layer and duo-icons-primary-layer, you can modify the color, opacity, and more. For tailwindcss, there are custom variants that allow modification through their own utilities. You can see an example of the implementation and how easy it is in the @duo-icons/tailwind package.

 <style>
    .duo-icons-primary-layer{
      color:red
    }
    .duo-icons-secondary-layer{
      /*By default, the child layer has an opacity of 30% applied. If you apply color to the child layer, be sure to set the opacity to 1 */
      opacity:1;
      color:blue
    }
  </style>
<i data-duo-icons="box"></i>

Examples of use

Examples of use

import * as DuoIcons from 'duo-icons';

// Replace all icons in the document
DuoIcons.createIcons();

Example with options

import * as DuoIcons from 'duo-icons';

// Replace icons only in a specific container, with custom attributes
DuoIcons.createIcons({
  root: '#app',
  attributes: {
    class: 'size-5',
    'data-tooltip': 'My icon'
  },
  icons: {
    'my-icon': '<svg>...</svg>' // Custom icon
  }
});

Example with CDN

<div id="app">
  <span data-duo-icons="box"></span>
  <span data-duo-icons="box"></span>
</div>

<script src="https://unpkg.com/duo-icons@latest"></script>
<script>
  DuoIcons.createIcons({
    root: '#app',
    attributes: { class: 'svg-icon' }
  });
</script>

For more details about the available icons, see the DuoIcons.icons property which contains an object with all the included icons.