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/react-icons
Advanced tools
PatternFly 4 Icons as React Components.
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
const closeIcon = <TimesIcon />;
For a list of the available icons please refer to the PatternFly React Docs
Every icon component has the following props:
Prop | Description | Default |
---|---|---|
color | Color of the icon (e.g. red, white, #c3ee) | 'currentColor' |
size | Size of the icon. There are 4 different sizes: sm, md, lg and xl | sm |
title | Label of the icon | null |
Icons for this package are generated from the @fortawesome/free-solid-svg-icons
package. To add more to what is generated, modify the icons.js file in the build folder.
If you have some custom icon defined by svg path the best way to add such icon to this repository is to add its path definition in pfIcons.js file in the build folder.
module.exports = {
pfIcons: {
// ... other icon defintions
bigPlus: {width: 1024, height: 1024, svgPathData: 'M2 1 h1 v1 h1 v1 h-1 v1 h-1 v-1 h-1 v-1 h1 z'}
}
}
Ensure optimization.sideEffects is set to true within your Webpack config:
optimization: {
sideEffects: true
}
Use ESM module imports to enable tree shaking with no additional setup required.
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
To enable tree shaking with named imports for CJS modules, utilize babel-plugin-transform-imports and update a babel.config.js file to utilize the plugin:
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
[
"transform-imports",
{
"@patternfly/react-icons": {
transform: (importName, matches) => `@patternfly/react-icons/dist/js/icons/${importName.split(/(?=[A-Z])/).join('-').toLowerCase()}`,
preventFullImport: true
}
}
]
]
}
FAQs
PatternFly 4 Icons as React Components
The npm package @patternfly/react-icons receives a total of 37,890 weekly downloads. As such, @patternfly/react-icons popularity was classified as popular.
We found that @patternfly/react-icons 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.
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.