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

calcite-ui-icons-react

v0.39.0

Published

Calcite UI Icons for React

Downloads

1,610

Readme

calcite-ui-icons-react

Calcite UI Icons as individual React components. https://esrips.github.io/cui-icons-reference/

Installation

npm i calcite-ui-icons-react

Quick Start

Here are some quick examples:

import BikingIcon from 'calcite-ui-icons-react/BikingIcon';
import ArticleIcon from 'calcite-ui-icons-react/ArticleIcon';
import CircleIcon from 'calcite-ui-icons-react/CircleIcon';

const MyComponent = () => (
  <div>
    <BikingIcon size={36} />
    <ArticleIcon color="#ddd" />
    <CircleIcon size={48} color="rgba(255, 255, 255, 0.5)" />
  </div>
);

Component Names

Find the icon you want to use here: https://esri.github.io/calcite-ui-icons/

The name of the React component you will import is simply the icon name in PascalCase suffixed with Icon.

For example:

If you want to use the globe and caret-square-down icons...

import GlobeIcon from 'calcite-ui-icons-react/GlobeIcon';
import CaretSquareDownIcon from 'calcite-ui-icons-react/CaretSquareDownIcon';

const MyComponent = () => (
  <div>
    <GlobeIcon />
    <CaretSquareDownIcon />
  </div>
);

Sizes

Calcite UI Icons come in three size variations: 16px, 24px, and 32px. Note that these are three unique SVGs to avoid issues when scaling vector graphics. You can read more about this here.

Each component in this library includes all three of these unique SVGs - simply pass a size prop, and we'll pick the right one for you. Note that if you don't include a size prop, it defaults to 24. The 32px SVG will be used whenever a size prop greater than 24 is found.

import Globe from 'calcite-ui-icons-react/Globe';

const MyComponent = () => (
  <div>
    {/* size will be 24, 24px version of SVG will be used */}
    <Globe />

    {/* size will be 12, 12px version of SVG will be used */}
    <Globe size={12} />

    {/* size will be 48, 32px version of SVG will be used */}
    <Globe size={48} />
  <div>
)

Color

All components accept a color prop, which will be applied to the fill attribute on the <svg> element. This means any valid CSS color value can be used (e.g. "red", "#e34f2c", "rgba(255, 0, 0, 0.5)"). If a color prop is not found, we will set it to "currentColor".

Styling

All components get a calcite-ui-icon css class that you can use for generic styling. We merge in a className prop if you provide one. We also spread all other props onto the <svg> element for you.

Gotchas

Since JavaScript variables cannot start with a number - we convert any icon name that begins with a number so that the word (or words, in PascalCase) are used instead.

Currently, there are only two such cases:

| Calcite UI Icons name | React Component Name | | --------------------- | -------------------- | | 2d-explore | TwoDExplore | | 3d-glasses | ThreeDGlasses |