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

@nypl/dgx-svg-icons

v0.3.14

Published

React DGX SVG Icons

Downloads

979

Readme

NYPL SVG Icons

GitHub version

SVG icons used at NYPL Digital as React Components. Version 0.3.12

This project uses Styleguidist to generate a page with all the available icons and their properties here: https://nypl.github.io/dgx-svg-icons/

Install

npm i --save @nypl/dgx-svg-icons

Demo

  • npm install
  • npm start
  • Go to localhost:3000

Importing

All the icons are exported individually so you can choose which ones you want to import.

import React from 'react';
import { render } from 'react-dom';

import {
  LionLogoIcon,
  BookIcon,
} from 'dgx-svg-icons';


render(
  <LionLogoIcon ariaHidden />,
  document.getElementById('LionLogoIcon')
);

Contributing to this repo

  • Create a feature branch from development
  • From the command line rebuild the /dist directory with npm run build.
  • Optional but useful: rebuild the /docs styleguide with npm run styleguide:build.
  • Add & commit the new /dist and /docs folders and make the pull request with development as the base.
  • Changes must be approved by a peer reviewer
  • Merge changes upon approval
  • Merge development into master
  • Create a tag for use by npmjs.com

Props

There are props that all components use:

prop | type --- | --- ariaHidden | boolean className | string height | string iconId | string preserveAspectRatio | string svgRole | string title | string width | string viewBox | string

By default, the defaultProps generate:

  • viewBox
  • title
  • className
  • preserveAspectRatio
  • svgRole

There are also props such as fill, style, and size for only a few components.

Accessibility Guidelines

There are certain icons that will appear multiple times and have presentational value, but not necessarily semantic or have value with respect to accessibility, and others where there should only be one instance.

In the case of multiple rendering of an icon, such as the three-dotted "more" icon a unique ID is not required and should not be set (unless your application requires it to be set), but it should have the ariaHidden attribute set (if not already set by default in the icon.jsx file).

Example:


render(<DotsIcon ariaHidden />);

In the case where a unique id should be set for each instance and in the case of it appearing multiple times. The iconId property will set id="{iconId}" on the svg's title attribute, this will also set aria-labelledby attribute on the <svg> tag. icon.jsx files that should have an id will throw a console error if it is missing, but the .jsx file itself will not set one by default, you must explicitly set it.

Example:


render(<LoginIcon iconId="login-icon" />);

Styleguide

We are using Styleguidist as an interactive styleguide for our icon components. To run the styleguide locally, run

    $ npm run styleguide

Alternatively, you can build the styleguide and start a local server in the generated /docs folder. To do so, run

    $ npm run styleguide:build

then run

    $ cd docs && python -m SimpleHTTPServer 4000

then go to localhost:4000 to see the styleguide. Doing this will serve the same styleguide that Github Pages will serve up... like a hot-fudge sunday.

Reference

Component Name | Component Markup --- | --- ApplyIcon | <ApplyIcon /> AudioDiscIcon | <AudioDiscIcon /> AudioHeadphoneIcon | <AudioHeadphoneIcon /> BookIcon | <BookIcon /> CarouselCircleIcon | <CarouselCircleIcon /> CheckSoloIcon | <CheckSoloIcon /> CircleDashIcon | <CircleDashIcon /> DivideLineIcon | <DivideLineIcon /> DotsIcon | <DotsIcon /> DownLoadIcon | <DownLoadIcon /> DownWedgeIcon | <DownWedgeIcon /> DvdDiscIcon | <DvdDiscIcon /> EReaderIcon | <EReaderIcon /> EnvelopeIcon | <EnvelopeIcon /> FaceBookIcon | <FaceBookIcon /> FilterIcon | <FilterIcon /> FilterCancelIcon | <FilterCancelIcon /> GridIcon | <GridIcon /> LargePrintIcon | <LargePrintIcon /> LeftWedgeIcon | <LeftWedgeIcon /> LionLogoIcon | <LionLogoIcon /> LionLogoWithText | <LionLogoWithText /> LionLogoWithTextInverse | <LionLogoWithTextInverse /> ListIcon | <ListIcon /> LibraryCardIcon | <LibraryCardIcon /> LocatorIcon | <LocatorIcon /> LoginIcon | <LoginIcon /> LoginIconSolid | <LoginIconSolid /> LogoutIcon | <LogoutIcon /> MediaBluRayIcon | <MediaBluRayIcon /> MenuIcon | <MenuIcon /> NYPLTextLogo | <NYPLTextLogo /> RadioActiveIcon | <RadioActiveIcon /> RadioInactiveIcon | <RadioInactiveIcon /> ResetIcon | <ResetIcon /> RightWedgeIcon | <RightWedgeIcon /> SearchIcon | <SearchIcon /> SmallDotClosedIcon | <SmallDotClosedIcon /> SmallDotOpenIcon | <SmallDotOpenIcon /> TagIcon | <TagIcon /> TwitterIcon | <TwitterIcon /> XIcon | <XIcon /> xCloseIcon | <XCloseIcon /> BuildingIcon | <BuildingIcon /> GenericWedgeIcon | <GenericWedgeIcon /> LeftArrowIcon | <LeftArrowIcon /> RightArrowIcon | <RightArrowIcon />