peri-verse-react-icons 1.0.0
Install from the command line:
Learn more about npm packages
$ npm install @nandosuk/peri-verse-react-icons@1.0.0
Install via package.json:
"@nandosuk/peri-verse-react-icons": "1.0.0"
About this version
This package is responsible for the React implementation of PERi-Verse Icons. The main function of this package is:
- Copying SVG files from the third party package
@material-symbolsto thesvgfolder - Generating React components from each copied SVG file
- Exporting all the components
All supported icons are listed as an array in the supported-icons.js file. These icons are sourced from the Material Symbols Library, with the following specs:
- Fill: 0 (1 if needed)
- Weight: 400
- Grade: 0
- Size: 48px
- Visit the Material Symbols Library
- Copy the name of the icon you want to add (e.g.,
ad_group) - Add the icon name to the
supported-icons.jsarray - Run
yarn buildin your terminal- This will copy the SVG file of the new icon to the
svgdirectory and generate a new React component for it
- This will copy the SVG file of the new icon to the
- Commit and push the changes in a new PR
- Once merged, the new icon will be available to be imported as component
Enable the newly generated icon in the Icon component of the react-components package, specifically in the icons mapper:
- Open the
iconMapper.tsfile inside theIconcomponent - Import the icon component from this package
- Add a new entry to the mapper object
- The key matching the icon name from the Material Symbols Library
- The value being the name of the generated icon component
- Refer to the
distfolder if unsure about the component's name
// packages/react-components/src/lib/components/Icon/iconMapper.ts
{
AdGroup,
// ...
} from '@nandosuk/peri-verse-react-icons';
const iconMapper = {
// ...
ad_group: AdGroup,
}
export { iconMapper };After adding the entry to the icons mapper, the new icon can be used with the Icon component:
import { Icon } from '@nandosuk/peri-verse-react-components';
<Icon name="ad_group" />;| Command | Description |
|---|---|
yarn build |
Converts SVG files into React components by running yarn copy and yarn svg-react
|
yarn copy |
Copies all supported SVG icon files from @material-symbols/svg-400 into the local src/svg directory |
yarn svg-react |
Generates React components from all local files created by the copy script |
yarn commit |
Correctly formats a commit message via prompts |
yarn test |
Runs unit tests using jest
|
Details
- peri-verse-react-icons
-
NandosUK
- 10 months ago
- UNLICENSED
- 4 dependencies
Assets
- peri-verse-react-icons-1.0.0.tgz
Download activity
- Total downloads 1
- Last 30 days 0
- Last week 0
- Today 0