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.
@patternfly/pfe-icon
Advanced tools
Read more about Icon in the PatternFly Elements Icon documentation
Load <pfe-icon>
via CDN:
<script src="https://unpkg.com/@patternfly/pfe-icon?module"></script>
Or, if you are using NPM, install it
npm install @patternfly/pfe-icon
Then once installed, import it to your application:
import '@patternfly/pfe-icon';
Place the icon element on the page and give it an icon name from the default icon set.
In most cases, the icon should be labelled using aria-label
or aria-labelledby
, or removed from
the accessibility tree with aria-hidden="true"
or role="presentation"
, if its content is merely
presentational and expressed using accessible text copy elsewhere.
<pfe-icon icon="award" aria-label="Awards"></pfe-icon>
If you wish to display some content while the icon loads (or while JS is disabled),
you can slot it into <pfe-icon>
. For instance, when using a checkmark icon in a server status
table, you may wish to display a checkmark emoji if JS is disabled.
<pfe-icon icon="check">✅</pfe-icon>
Icon comes with three built-in icon sets:
fas
: Font Awesome Free Solid icons (the default set)far
: Font Awesome Free Regular iconspatternfly
: PatternFly iconsUse the set
attribute to pick an alternative icon set.
<pfe-icon icon="star" set="far"></pfe-icon>
<pfe-icon icon="redhat" set="fab"></pfe-icon>
<pfe-icon icon="package" set="patternfly"></pfe-icon>
It is possible to add custom icon sets or override the default sets. Icon sets are defined in detail in the docs.
When bundling PfeIcon with other modules, the default icon imports will be relative to the bundle, not the source file, so be sure to either register all the icon sets you'll need, or override the default getter.
// Workaround for bundled pfe-icon: make icon imports absolute, instead of relative to the bundle
import { PfeIcon } from '/pfe.min.js';
PfeIcon.getIconUrl = (set, icon) =>
new URL(`/assets/icons/${set}/${icon}.js`, import.meta.url);
// default: new URL(`./icons/${set}/${icon}.js`, import.meta.url);
Icons load lazily by default, meaning that the browser will not attempt to fetch and render the
icon until it scrolls into view. You can change this with the loading
attribute;
see the docs for more info.
FAQs
Icon element for PatternFly Elements
The npm package @patternfly/pfe-icon receives a total of 880 weekly downloads. As such, @patternfly/pfe-icon popularity was classified as not popular.
We found that @patternfly/pfe-icon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 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.
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.