0.0.3 • Published 5 years ago

ngg-icons v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

NPM version NPM downloads

Install

yarn add @ant-design/icons # or npm install @ant-design/icons --save

Use Library Adapter

Usage

import { AlertOutline } from '@ant-design/icons';
// or import AlertOutline from '@ant-design/icons/lib/outline/AlertOutline';

console.log(AlertOutline);
// Output:
// {
//     name: 'alert',
//     theme: 'outline',
//     icon: {
//         tag: 'svg',
//         attrs: { viewBox: '64 64 896 896' },
//         children: [
//             {
//                 tag: 'path',
//                 attrs: {
//                     d: 'M193 796a32 32 0 0 0 32 32h574a32....'
//                 }
//             }
//         ]
//     }
// }

Interface

This library export all SVG files as IconDefinition.

interface AbstractNode {
  tag: string;
  attrs: {
    [key: string]: string;
  };
  children?: AbstractNode[];
}

interface IconDefinition {
  name: string; // kebab-case-style
  theme: ThemeType;
  icon:
    | ((primaryColor: string, secondaryColor: string) => AbstractNode)
    | AbstractNode;
}

Build

npm run generate # Generate files to ./src
npm run build # Build library
npm run test # Runing Test