
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
astro-icon
Advanced tools
A straight-forward Icon
component for Astro.
astro-icon
will automatically optimize icons with svgo
and inline them directly into your HTML—no extra build step, no spritesheet complexity, no cross-browser concerns! See "A Pretty Good SVG Icon System" from CSS Tricks.
astro-icon
.npm i astro-icon
# or
yarn add astro-icon
src/
named icons/
..svg
file to src/icons/
name
prop.---
import { Icon } from 'astro-icon';
---
<!-- Loads the SVG in `/src/icons/filename.svg` -->
<Icon name="filename" />
Sprite
and SpriteSheet
components. These leverage <use>
internally.---
import { Sprite, SpriteSheet } from 'astro-icon';
---
<!-- Uses the sprite from `/src/icons/filename.svg` -->
<Sprite name="filename" />
<!-- Required ONCE per page, creates `<symbol>` for each icon -->
<SpriteSheet />
Styling your astro-icon
is straightforward. Any styles can be targeted to the [astro-icon]
attribute selector. If you want to target a specific icon, you may target it by name using [astro-icon="filename"]
.
---
import { Icon } from 'astro-icon';
---
<style lang="css">
[astro-icon] {
color: blue;
}
[astro-icon="annotation"] {
color: red;
}
</style>
<Icon name="adjustment" /> <!-- will be blue -->
<Icon name="annotation" /> <!-- will be red -->
<Icon>
requires the name
prop to reference a specific icon.
<Icon>
optionally accepts the optimize
prop as a boolean. Defaults to true
. In the future it will control svgo
options.
<Icon>
also accepts any global HTML attributes and aria
attributes. They will be forwarded to the rendered <svg>
element.
See the Props.ts
file for more details.
FAQs
This **[Astro integration](https://docs.astro.build/en/guides/integrations-guide/)** provides a straight-forward `Icon` component for [Astro](https://astro.build).
The npm package astro-icon receives a total of 35,023 weekly downloads. As such, astro-icon popularity was classified as popular.
We found that astro-icon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.