@realtby/icons
TypeScript icon, indicating that this package has built-in type declarations

1.1.48 • Public • Published

realt.by icons library

npm code style: prettier

realt.by icons storybook

install

npm i -S @realtby/icons

usage

  1. import icons.css to your project, for example:
import '@realtby/icons/dist/icons.css';
  1. import icons from lib root:
import { SuccessIcon } from '@realtby/icons';
  1. render icon, pass props:
<SuccessIcon size={20} className="text-success-500" />

development

make install
make dev # run storybook
make lint
make build
make release # to push new version & generate changelog
make prerelease # then select pre- version, only push new version to npm, for testing
make build-size # reset cache, build & run size-limit
make size-limit-generate # generate icon size limit

How add svg to the library

  1. Copy the raw svg (for example: login.svg) and put it in the desired folder in src/icons (for example: admin):
  src/
      icons/
            ...
            admin/
                  ...
                  login.svg
  1. Run svg:processing script for the admin folder:
  $ npm run svg:processing src/icons/admin
  1. Check result:
  src/
      icons/
            ...
            admin/
                  ...
                  login.optimized.svg
                  login.tsx
                  index.tsx

Note: Processing performs an average optimization. For the best result, optimize the icon manually in the SVGOMG service, save it to a file with the extension .optimized.svg and run svg:processing again.

  1. Generate icon size-limit:
$ make build
$ make size-limit-generate

/@realtby/icons/

    Package Sidebar

    Install

    npm i @realtby/icons

    Weekly Downloads

    1

    Version

    1.1.48

    License

    UNLICENSED

    Unpacked Size

    1.28 MB

    Total Files

    264

    Last publish

    Collaborators

    • e-egor
    • romant37
    • gyegor
    • felon_91
    • r1zen
    • realtby-admin