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

@rnbws/svg-icon.js

v0.0.1

Published

js library which allows you to use svg-icon tag <svg-icon></svg-icon>

Downloads

490

Readme

svg-icon.js

Web component for SVG icons. Works in any web framework and for any purpose. Optimized for smooth design and development workflow (we built it for ourselves!).

Install with Unpkg CDN

  1. Add the following script to your page:
    <script src="https://unpkg.com/@rnbws/svg-icon.js/dist/svg-icon.min.js"></script>

Install with NPM

  1. On you Terminal

    npm i @rnbws/svg-icon.js
  2. Use /svg-icon.config.json in your root directory and set the default source.

    You can use relative path based on the root directory

    { "src": "icons/" }

    It can be also any other CDN

    { "src": "https://raincons.rnbw.dev/" }
  3. Enjoy icons/icons.html to view all your icons in a simple, organized, and searchable manner.

  4. Place all of your icons in /icons at your root directory.

    root/
    ├─ icons/
    │  ├─ icon1.svg
    │  ├─ icon2.svg
    │  ├─ icon3.svg/

    You’re ready to go!

Usage

  1. Set the icon-name within the element’s content.

    <svg-icon>arrow</svg-icon>

    Or, you can do folder/icon-name if you’ve categorized your library into folders.

    <svg-icon>arrows/right</svg-icon>

    Override the source directly by setting a different one in the src attribute. You can Either use internal or external links.

    <svg-icon src="https://rnbw.company/images/icon.svg"></svg-icon>
  2. Colors are one of the main reasons svg-icon.js was created!

    The fill color of svg-icons is set by default to the inherited color of the font, so it can be overridden using a plain CSS selector.

    <div style="color: red;">
      <svg-icon>arrow</svg-icon>
    </div>

    And, you can always override colors using the color attribute.

    <svg-icon color="red">arrow</svg-icon>
  3. You can set the size directly (or simply apply your own CSS).

    <svg-icon size="80">arrow</svg-icon>

Dependencies

Many thanks to svg-inject for enabling the passing of properties to SVG files.

Documentation

Visit svg-icon.fyi to view the full documentation.

Community

The svg-icon.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

Join Rainbow's Discord to chat with other community members about svg-icon.js.

Contributing

Please see our contributing.md.

That's it! 🎉