2.0.5 • Published 3 years ago

@iconbox/snapp v2.0.5

Weekly downloads
5
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

How to use iconbox?

Icons are available in svg format, react components and a special way of sprite file, which allows you to sprite svg icons in a pack. e.g. if you are using webpack you could use svg-sprite-loader

React svg components

Choose your icon from our webapp then import it where ever you want:

import { MoodSadIcon } from '@iconbox/tabler';

const Component = () => {
  return <MoodSadIcon />;
}

If you want to improve bundle size and jusgt complie used svg files:

[
  'transform-imports',
  {
    '@iconbox\/?(((\\w*)?\/?)*)': {
      'transform': isClient ? '@iconbox/${1}/esm/${member}' : '@iconbox/${1}/${member}',
    },
  }
]

the isClient could decide between SSR and CSR and load svg files cjs version in server.

Sprite svg components

Choose your icon from our webapp then import it where ever you want:

import { MoodSadIcon } from '@iconbox/tabler/sprite';

const Component = () => {
  return <MoodSadIcon />;
}

If you want to improve bundle size and jusgt complie used svg files:

[
  'transform-imports',
  {
    '@iconbox\/?(((\\w*)?\/?)*)\/sprite': {
      'transform': isClient ? '@iconbox/${1}/esm/${member}/sprite' : '@iconbox/${1}/${member}/sprite',
    },
  }
]

the isClient could decide between SSR and CSR and load svg files cjs version in server.

which file should I use?

You can use whatever version you want, we provide various versions of icons for every pack. But we advice reading this article about FontIcons vs Svg Icons compare by CssTricks first.

license

This repo is just a wrapper to exist icon packs, so please respect every icon pack license you use.