
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
carbon-pictograms-svelte
Advanced tools
Carbon Design System SVG pictograms as Svelte components.
This zero dependency library builds Carbon Design System pictograms as Svelte components. Although best paired with carbon-components-svelte, this library can be consumed standalone.
carbon-pictograms-svelte
can be installed using yarn
or npm
.
yarn add -D carbon-pictograms-svelte
# OR
npm i -D carbon-pictograms-svelte
<script>
import { Airplane } from "carbon-pictograms-svelte";
</script>
<Airplane />
Import pictograms directly for faster compiling.
import Airplane from "carbon-pictograms-svelte/lib/Airplane";
Note: Even if using the base import method, an application bundler like Rollup or Webpack should treeshake unused pictograms from the production build.
import Pictogram from "carbon-pictograms-svelte/lib/<ModuleName>";
Refer to PICTOGRAM_INDEX.md for a list of available pictograms.
All props are optional.
Name | Value |
---|---|
id | string |
aria-label | string |
aria-labelledby | string |
tabindex | string |
title | string |
focusable | boolean (default: false ) |
class | string |
style | string |
fill | string (default: "#161616" |
stroke | string (default "currentColor" ) |
width | string (default: "48" ) |
height | string (default: "48" ) |
title
as a Slottitle
can be passed as a prop or through the slot as an element.
<Airplane title="Airplane" />
<!-- OR -->
<Airplane>
<title>Airplane</title>
</Airplane>
Event directives are forwarded to the SVG element.
<Airplane
on:click="{() => {}}"
on:mouseenter="{() => {}}"
on:mouseover="{() => {}}"
on:mouseleave="{() => {}}"
on:keyup="{() => {}}"
on:keydown="{() => {}}"
/>
data-carbon-pictogram
selectorEach pictogram embeds its module name in the data-carbon-pictogram
selector for querying. This may be useful for automated testing in a headless browser.
<svg data-carbon-pictogram="Airplane">...</svg>
// selects all carbon pictograms
document.querySelectorAll("[data-carbon-pictogram]");
// selects all `Airplane` pictograms
document.querySelectorAll('[data-carbon-pictogram="Airplane"]');
Customize the stroke color through the stroke
proop or by defining a global class.
stroke
prop<Airplane stroke="blue" />
<style>
:global(svg.custom-class) {
stroke: blue;
}
</style>
<Airplane class="custom-class" />
<Airplane aria-label="Airplane" />
<Airplane aria-label="Airplane" tabindex="0" />
<label id="transportation">Transportation</label>
<Airplane aria-labelledby="transportation" />
examples/webpack (Try it on CodeSandbox)
examples/rollup (Try it on CodeSandbox)
FAQs
Carbon Design System SVG pictograms as Svelte components
The npm package carbon-pictograms-svelte receives a total of 1,717 weekly downloads. As such, carbon-pictograms-svelte popularity was classified as popular.
We found that carbon-pictograms-svelte demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.