S4E Icon Library is a customizable React icon library. Below are the steps to add, update, and publish icons in this library. https://www.npmjs.com/package/@s4e/icons
- Place the new SVG file inside the
src/icons
folder.
-
Run the following command to generate React components from the SVG files:
npm run generate-icons
-
If a component already exists for the given SVG, it will be skipped.
-
Ensure that all generated components are exported in
src/index.ts
by running:npm run generate-exports
-
Existing exports will not be duplicated.
-
Compile the TypeScript files into JavaScript by running:
npm run build
-
Increment the version number and publish the package:
npm version patch npm publish
src/
├── components/
│ ├── IconName/
│ │ └── index.tsx
├── icons/
│ ├── icon-name.svg
├── index.ts
-
npm run generate-icons
: Converts all SVG files insrc/icons
into React components. -
npm run generate-exports
: Ensures all components are exported insrc/index.ts
. -
npm run build
: Compiles TypeScript files to JavaScript. -
npm version patch
: Updates the package version (patch level). -
npm publish
: Publishes the package to NPM.
- Ensure
src/icons
contains only valid SVG files.