Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
react-svg-sprite-icon
Advanced tools
A React icon component that generates a SVG sprite on the fly
A React icon component that generates a SVG sprite on the fly
npm install --save react-svg-sprite-icon
React SVG Sprite Icon provides two components, one ES6 Class and one stateless function.
If you're unsure which one to use, use the class.
import { IconClass as Icon } from 'react-svg-sprite-icon';
import iconClose from 'svg-icon-template-loader!./close.svg';
const Foo = React.createClass({
render() {
return (
<div>
<h1>Icon</h1>
<Icon name="close" svg={ iconClose } stroke="#ff0000" />
</div>
);
}
});
All options are passed to the component via props.
The name of the icon, the class and ID are based on this so keep it meaningful.
The function returned by svg-icon-template-loader.
The fill override that is passed to the svg-icon-template-loader function.
The stroke override that is passed to the svg-icon-template-loader function.
The stroke width override that is passed to the svg-icon-template-loader function.
The width of the icon.
The height of the icon.
A style object that'll be applied to the root icon element.
A class name that'll be applied to the root icon element.
The ID of the SVG sprite that is added to the root of the document, svg-icon-container
by default.
The type of element of the root icon element, a span
by default.
This open source project released by Nordnet is licensed under the MIT license.
FAQs
A React icon component that generates a SVG sprite on the fly
The npm package react-svg-sprite-icon receives a total of 0 weekly downloads. As such, react-svg-sprite-icon popularity was classified as not popular.
We found that react-svg-sprite-icon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.