Performance
What an icon costs and how to keep it small.
| Size (before gzip) | |
|---|---|
| One variant of an icon | About 1 to 2 KB for outline, solid or duotone; about 5 KB for glass |
| Its motion | About 0.4 KB |
| A free icon from npm (all four variants) | About 9 KB |
| Runtime (motion and sound) | About 25 KB minified (12 KB gzipped), shared by every icon |
- Import icons by name. The packages have no side effects, so bundlers drop icons you never import.
- Add only the variants you use.
npx jiggicons add bell --variants outlineleaves out the other three. This matters most for glass. - The still icon is plain SVG. It renders on the server or in the first paint, with no request and no layout shift. Motion uses the Web Animations API on the compositor, at about 60 frames a second, and does nothing while idle.
- Sound is made only when played. It is synthesised for each icon from its motion, kept for reuse, and never downloaded.
Hundreds of icons on one page are fine. Each one only listens for the pointer until it plays.