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

live-icons

v1.0.2

Published

Plain JS Webcomponents Live Icons based upon SVG

Readme

Live-Icons

Plain JS Interactive Icons based upon SVG demo here

NPM

Library goals

  • Dependency free library
  • Easy to use, understand and to extend
  • Native es6 with Classes and webcomponents
  • Open to contribute for everyone

Installation

NPM

To use this library with npm, just install it with the following command.

npm i live-icons

In your JavaScript file, import the project like following

import 'live-icons';

Plain HTML

You can use this library by just downloading the index.js file and include it into your project.

Usage

The library can be used in two different ways:

  1. As ready to use webcomponents as shown in the examples below. After the .js file is loaded, just call the function registerInteractiveIcons() to register the icons as webcomponents.
  2. As es6 classes to manually create objects and attach them to your DOM programmatically or enhance them with additional functionality.

Light Demo

Light Icon Example

Light icon visualized as a light-bulb to show status and color.

Attributes:

  • power: Float value between 0.0 and 1.0
  • color: HTML color string for the light bulb on color

Example:

<div>
    <div style="width: 300px; height: 300px;">
        <live-icon-light />
    </div>
    <input type="range" min="0" max="1" value="0" step="0.001"
        oninput="document.querySelector('live-icon-light').power = this.value">
    <button onclick="document.querySelector('live-icon-light').setAttribute('power', 1)">On</button>
    <button onclick="document.querySelector('live-icon-light').power = 0">Off</button>
    <input type="color" name="favcolor" value="#ff0000"
        onchange="document.querySelector('live-icon-light').color = this.value; console.log(this.value);">
</div>

Blind Demo

Blind Icon Example

Blind icon to show the position of a blind

Attributes:

  • open: Float between 0.0 and 1.0 to define how much the blind is lowered
  • angle: Float between 0.0 and 1.0 to define how much the blind is tilted

Example:

<div>
    <div style="width: 300px; height: 300px;">
        <live-icon-blind />
    </div>
    <input type="range" min="0" max="1" value="0" step="0.001"
        oninput="document.querySelector('live-icon-blind').open = this.value">
    <input type="range" min="0" max="1" value="0" step="0.001"
        oninput="document.querySelector('live-icon-blind').angle = this.value">
</div>

Socket Demo

Socket Icon Example

Socket icon to visualize if something is plugged in.

Attributes:

  • power: Integer either 0 or 1 to visualize the status

Example:

<div>
    <div style="width: 300px; height: 300px;">
        <live-icon-socket />
    </div>
    <button onclick="document.querySelector('live-icon-socket').setAttribute('power', 1)">On</button>
    <button onclick="document.querySelector('live-icon-socket').power = 0">Off</button>
</div>

Meter Demo

Meter Icon Example

Meter icon to visualize a consumption.

Attributes:

  • value: The actual value of consumption to show
  • max: The maximal value reachable (red area)

Example:

<div>
    <div style="width: 300px; height: 300px;">
        <live-icon-meter max="9999" />
    </div>
    <input type="range" min="0" max="9999" value="0" step="0.001"
        oninput="document.querySelector('live-icon-meter').value = this.value">
</div>

Contributing

Please contribute!

The goal is to make this library as usefull as possible :)

If you need any kind of help, open an issue or write me an mail. Pull requests are welcome!

License

Copyright © 2019 Robert Schütte

Distributed under the MIT License.