New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

genericons-neue-react

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genericons-neue-react

Genericons Neue icon set to be used with React

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-75%
Maintainers
2
Weekly downloads
 
Created
Source

Genericons Neue for React

A library to make it easy to use Genericons Neue within React. You only need to import the icons you use, so no extra overhead.

Usage

Here's an example on using within your React project.

  1. First install the package
$ npm install --save genericons-neue-react
  1. Using inside a Component

import React from 'react';
import CloudUpload from 'genericons-neue-react/icons/cloud-upload';

const MyUploadButton = () => {
    return (
        <button>
            <CloudUpload />
            <span> Upload a new image </span>
        </button>
    )
}
Example

You can also pass down any properties to the SVG, for example:


import React from 'react';
import CloudUpload from 'genericons-neue-react/icons/cloud-upload';

const MyUploadButton = () => {
    return (
        <button>
            <CloudUpload fill="tomato" />
            <span> Upload a new image </span>
        </button>
    )
}
Example with Fill

Building this Package

The following info is for creating this package, if you just want to use the icons in your project, see Usage above.

The source SVG files are from automattic/genericons-neue repository, which gets installed as a dev dependcy.

The convert.js script runs through the SVG files and creates React Components (jsx), using the filename as the component name. Component names are CamelCase so cloud-upload.svg becomes CloudUpload.

This build step can be run using: npm run build and creates the components in src directory.

Next we convert the JSX components in src directory to vanilla javascript using babel and store the results in icons directory.

Keywords

FAQs

Package last updated on 07 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc