How to use the feather-icons/dist/icons.json function in feather-icons

To help you get started, we’ve selected a few feather-icons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathericons / react-feather / bin / build.js View on Github external
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable prefer-template */
const path = require('path');
const fs = require('fs');
const format = require('prettier-eslint');
const upperCamelCase = require('uppercamelcase');
const featherIcons = require('feather-icons/dist/icons.json');

const rootDir = path.join(__dirname, '..');

const icons = Object.keys(featherIcons);

const dir = path.join(rootDir, 'src/icons');

if (!fs.existsSync(dir)) {
  fs.mkdirSync(dir);
}

const initialTypeDefinitions = `/// 
import { ComponentType, SVGAttributes } from 'react';

interface Props extends SVGAttributes {
  color?: string;
  size?: string | number;
}

type Icon = ComponentType;
github vrimar / construct-ui / scripts / generateIcons.js View on Github external
function exportIconNames() {
  return Object.keys(ICONS).map(iconName => {
    const constName = iconName.replace(/-/g, '_').toUpperCase();
    return `export const ${constName} = '${iconName}';`
  });
}
github vrimar / construct-ui / scripts / generateIcons.js View on Github external
function exportIconContents() {
  const contents = Object.keys(ICONS).map(iconName => `'${iconName}' : '${ICONS[iconName]}'\n`);
  return `export default { 
    ${contents} 
  }`;
}

feather-icons

Simply beautiful open source icons

MIT
Latest version published 7 months ago

Package Health Score

77 / 100
Full package analysis

Similar packages