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

devicon-react-svg

v0.2.4

Published

devicon-react-svg is an implementation of the Devicons icon library, which contains the logos of various popular programming languages, frameworks and design and development tools. devicon-react-svg returns a functional React component that, when passed t

Downloads

174

Readme

devicon-react-svg

devicon-react-svg is an implementation of the Devicons icon library (which contains the logos of various popular programming languages, frameworks and design and development tools) for React.

devicon-react-svg returns a functional React component that, when passed the name of a Devicon as the icon prop, will render it as an inline SVG (Scalable Vector Graphics) image.


Installation

To install with npm:

npm install --save devicon-react-svg

To install with Yarn:

yarn add devicon-react-svg

Usage

Import the default export from devicon-react-svg and use it in your JSX as you would any other React component. It accepts the prop icon, which should be the name of the Devicon as a string.

import React from "react";
import ReactDOM from "react-dom";
import DevIcon from "devicon-react-svg";

const Demo = props => {
    return (<DevIcon icon="react" />);
}

ReactDOM.render(<Demo/>, document.getElementById('root'));

You can style the SVG component by passing in a style prop or a viewBox prop, like this...

const devIconStyle = {
    fill: "thistle",
    width: "150px",
};

const Demo = props => {
    return (
        <DevIcon icon="react" style={devIconStyle} viewBox="0 0 32 32"/>
        );
}

or by using a library like styled-components...

import styled from "styled-components";

const StyledIcon = styled(DevIcon)`
    fill: thistle;
    width: 150px;
`;

const Demo = props => {
    return (<StyledIcon icon="css3" />);
}

Additional exports

A list of the icon names accepted by the component can be found in the Devicons cheatsheet, or can be returned as an array by using the package's iconList export. devicon-react-svg also exports the RandomIcon component to display a randomly chosen icon.

import DevIcon, {iconList, RandomIcon} from "devicon-react-svg";

console.log(`Here is a list of icon names used by this component: ${iconList}`);

const Demo = props => {
    return (<RandomIcon />);
}

Credits

devicon-react-svg was made by Dennis Hodges, a JavaScript developer.

Thank you to Theodore Vorillas, who created the font and icon collection that this component is based on, and which is the source of all of the svg path data used in this package.

You can find his original icon repository here: Devicons.


License

Copyright © 2019 Dennis Hodges

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.