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

@air/icons

v10.7.1

Published

Air's iconography

Downloads

1,420

Readme

@air/icons

Source of truth for SVG icons used at Air. Published as an NPM library for React consumers.

Installation

yarn add @air/icons

How do I add new icons to this collection?

  1. Download your SVG to any location on your computer. Note the location as you will need it in the next step.

  2. Run yarn workspace @air/icons run add:icon {path/to/icon} and follow the prompts.

  3. Ensure the icon is loaded correctly into the component: Add the correct props to the <path> tag

    • If there is only one path, you can still follow the proceeding rules, but you could also instead add the attribute to the svg element itself.
    • If the <path> has no stoke or fill, you need to add fill="currentColor" to it.
    • If the <path> has a defined fill and it's value isn't "currentColor", change it to that.
    • If the <path> has a defined stroke or other stroke-* properties, set stroke's value to "currentColor"
  4. Run yarn build to map the newly added icons

  5. yarn storybook to go and see the result of your work in Storybook.

How should I describe the commit via commitizen?

  • If you've added a new icon, that should be a "minor" version commit (usually "feature").
  • If you've edited an existing icon, that should be a "patch" version commit (usually "fix").
  • If you've removed an existing icon, that be a "major" version commit (usually "fix" and "breaking").

How do I use the icons in my React application?

Every component accepts all props that you'd expect an inlined svg to accept in a React environment. This includes className, style, fill, width, height, etc.

import { Check } from '@air/icons';

// ... later on, in some render method

<Check fill="#000000" width="24px" height="24px" />

Considerations when deciding if your icon belongs here

  1. If you want the icon to express meaning by itself (without text)...

Please render the SVG inline into your application. Be sure that aria-hidden="false" and also apply an id to the <title> aspect of the SVG. Lastly, give the value of that id to the attribute aria-labelledby on the actual <svg>.


  1. If you don't want the icon to be customizable (fill, stroke, etc.) via props...
  2. If you want the paths of the icon to be controllable in animations...

This repository is for uniformly behaving, customizable icon sets. Please deal with the SVGs yourself.


  1. If you want the paths of the icon to be customizeable...

You'll want to make a custom component in your application. Please deal with the SVGs yourself.


  1. If the icon has a predefined fill attribute on the actual <svg>...

Note that fill is transformed to be currentColor. All you'll need to do is ensure the icon is rendered in a parent element whose CSS property color is defined.

Dealing With SVGs Yourself

There are many situations where this repository won't help, as outlined above. If instructed to deal with SVGs yourself (in your application context), you have two options.

  1. Render SVGs inline - nothing wrong with that! Consider still using SVGO to optimize your SVG.

  2. Integrate svgr into your application, steal our SVGO "format" config, and simply manage the implementation yourself. Why the "format" config in a webpack tool? In this repo, we use the format config to minify IDs because it has the context of the filename for prefixing the IDs and keeping them unique. Our bundle config doesn't minify IDs because it assumes they've already been prefixed properly to ensure there are no ID collisions for consumption of multiple SVGs on one page.

  3. Using React Native? Import the SVG files inside your components using a package like react-native-svg-transformer.