Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
department-svg
Advanced tools
Svg sprite support for department.
npm i department-svg --save
There are two components, Svg
and SvgSprite
.
First, you need to create a sprite, where you will put all your svg files.
const CustomIcon = () => (
<symbol id="svg-custom-icon" viewBox="0 0 80 80">
<g>
<path d="M40 80L11.72 68.28 0 40l11.72-28.28L40 0l28.28 11.72L80 40 68.28 68.28zM13.92 66.08L40 76.88l26.08-10.8L76.88 40l-10.8-26.08L40 3.12l-26.08 10.8L3.12 40z"/>
<path d="M39.93 62.1A22.1 22.1 0 1 1 62 40a22.13 22.13 0 0 1-22.07 22.1zm0-41.32A19.22 19.22 0 1 0 59.15 40a19.24 19.24 0 0 0-19.22-19.22z"/>
</g>
</symbol>
)
const Sprite = () => (
<SvgSprite>
<Icon />
</SvgSprite>
)
Next, you need to include your sprite somewhere near the top so that you can use your svg elements everywhere.
const Layout = () => (
<main>
<Sprite />
<section>
<Svg title="icon" />
</section>
</main>
)
You can check the example
directory for a small example.
You need to pass a required prop title
to Svg
element. There is also an optional size
prop. All this properties will be used as a class for an element, so that you can style them easily.
MIT
FAQs
Svg sprite support for department.
The npm package department-svg receives a total of 2 weekly downloads. As such, department-svg popularity was classified as not popular.
We found that department-svg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.