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

@koorosh/icons

v0.8.3

Published

Icons for Cockroach UI exported as React Components

Downloads

7

Readme

@cockroachlabs/icons

a package containing Cockroach Labs icons as SVG for consumption by other components

This package serves as a store for SVG icons that are converted and published as React components.

Usage

While any icon in the collection of this package can be imported individually, in practice, for use in Cockroach Labs applications a number of components are exported from ui-components that provide types for intended Icon usages (sizes and fills). See below for examples.

import { Time } from "@cockroachlabs/icons";

const TimeButton = ({ timestamp }) => (
  <button>
    <Time /> {timestamp}
  </button>
);
import * as Icons from "@cockroachlabs/icons";

// ...

<EditMessage icon={Icons.Pencil} />;

Each Icon component will render an <svg /> element with an unbounded size and may not have a default fill color. These properties can be passed in as props.


  import { CheckCircleFilled } from "@cockroachlabs/icons";

  <CheckCircleFilled fill="green" height="24px" width="24px" />

  // or

  <CheckCircleFilled style={{ fill: "green", height: "24px", width: "24px" }} />

Icon sets and components

Icons with common attributes are grouped together into an exported collection, and generally have an associated component to render an icon from the set. The exported sets are,

  • System Icons - Used as visual representations of common actions and commands to provide additional context and enhance usability. These icons can be scaled up or down in size if necessary. They should only be used as 1 color.
  • Pictograms - Pictogram icons contain more than 1 color value and are larger in size than system icons. They are used to add personality, visual interest and branding into the UI where space is available.
  • Third Party Icons - Used to represent 3rd party logos within the UI. These icons can be scaled up or down in size if necessary and inherit the 3rd party brand colors.
  • Credit Cards - Credit card icons are used to represent credit card brands. They can be scaled up or down and can consist of colors outside our design system palette.
  • Flags - Flag icons are used to represent a region or country. They can be scaled up or down and can consist of colors outside our design system palette.
  • Illustrations - Illustrations are used at a large scale, typically in areas with a lot of space like empty states or 404 pages. They add personality, visual interest and branding into the UI.

These sets can be rendered using their associated component,

import { Icon, Pictogram, ThirdPartyIcon, CreditCard, Flag, Illustration } from "@cockroachlabs/ui-components";

/*
   ...snip
*/

<Icon iconName="Gear" size="small" fill="info" />

<Pictogram pictogramName="Email" size="medium" />

<ThirdParty iconName="Gcp" size="large" />

{/* Flag icons can be referenced by "flagName" or "countryCode" prop  */}
<Flag flagName="Canada" size="medium" />
<Flag countryCode="can" size="small" />

<CreditCard creditCardName="Visa" size="tiny" />

<Illustration illustrationName="SleepMoon" />

SVG prop pass through

The components that render icons all extend SVGElement props and so any component can take common HTML element attributes. For example,

  <Icon iconName="Pencil" size="small" className="edit-icon" aria-label="Edit field icon" id="edit-icon">

How do I contribute new icons?

See CONTRIBUTING.md for instructions on adding new icons and publishing new versions of the icons package.