@realtby/icons
v1.1.49
Published
realt.by icons library
Readme
@realtby/icons
realt.by icons library
install
npm i -S @realtby/iconsusage
- import
icons.cssto your project, for example:
import '@realtby/icons/dist/icons.css';- import icons from lib root:
import { SuccessIcon } from '@realtby/icons';- 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 limitHow add svg to the library
- Copy the raw
svg(for example:login.svg) and put it in the desired folder insrc/icons(for example:admin):
src/
icons/
...
admin/
...
login.svg- Run
svg:processingscript for theadminfolder:
$ npm run svg:processing src/icons/admin- Check result:
src/
icons/
...
admin/
...
login.optimized.svg
login.tsx
index.tsxNote: 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.svgand runsvg:processingagain.
- Generate icon size-limit:
$ make build
$ make size-limit-generate