PHPackages                             frostybee/swarm-icons - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. frostybee/swarm-icons

ActiveLibrary[Templating &amp; Views](/categories/templating)

frostybee/swarm-icons
=====================

Framework-agnostic PHP SVG icon library with first-class Twig support and Iconify API integration

v1.2.0(2mo ago)136↓50%MITPHPPHP ^8.2CI passing

Since Feb 26Pushed 2mo agoCompare

[ Source](https://github.com/frostybee/swarm-icons)[ Packagist](https://packagist.org/packages/frostybee/swarm-icons)[ Docs](https://github.com/frostybee/swarm-icons)[ RSS](/packages/frostybee-swarm-icons/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (18)Versions (5)Used By (0)

 [![SwarmIcons](swarm.svg)](swarm.svg)

Swarm Icons
===========

[](#swarm-icons)

**A Framework-Agnostic PHP Library for Rendering SVG Icons**

 [![Latest Version](https://camo.githubusercontent.com/fd9697accb213499249442d8e871162624885798c304f1eaaf90c7468c3c40b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66726f7374796265652f737761726d2d69636f6e732e737667)](https://packagist.org/packages/frostybee/swarm-icons) [![PHP Version](https://camo.githubusercontent.com/9baca503043438608995024d9b473c94d4ad558cd150de377bad27ca91cbc0dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f66726f7374796265652f737761726d2d69636f6e732e737667)](https://packagist.org/packages/frostybee/swarm-icons) [![License](https://camo.githubusercontent.com/77a31b6893c43975115b2fc17b6f33b156873a541c51ba2b0c97618d800c2ff0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66726f7374796265652f737761726d2d69636f6e732e737667)](https://packagist.org/packages/frostybee/swarm-icons)

 [![Documentation](https://camo.githubusercontent.com/531cd724edd8d0fa6413a8d8bcf8fbe66e2737042a7e39bf426b5d03586b6e21/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d737761726d2d2d69636f6e732d626c7565)](https://frostybee.github.io/swarm-icons/)

Features
--------

[](#features)

- Access **200,000+ icons** from 200+ [Iconify](https://iconify.design) sets, downloadable via CLI (no Node.js required)
- Load icons from local SVG directories, the Iconify API, JSON collections, or a hybrid of local files with API fallback
- Style icons with an immutable fluent API: `size()`, `class()`, `fill()`, `stroke()`, `rotate()`, `flip()`, and more
- Integrates with Twig, Laravel Blade, Slim, and CommonMark
- Deduplicate repeated icons on a page using SVG sprite sheets with `` / `` references
- Layer multiple icons into a single composite SVG with icon stacking
- Decorative icons get `aria-hidden="true"` automatically; labeled icons get `role="img"`
- SVG content is sanitized: scripts, event handlers, and external resources are stripped
- PSR-16 file-based caching with configurable TTL

Installation
------------

[](#installation)

```
composer require frostybee/swarm-icons
```

Requires PHP 8.2+ and `psr/simple-cache` ^3.0.

Quick Start
-----------

[](#quick-start)

Download icon sets and render:

```
php bin/swarm-icons json:download mdi tabler heroicons
```

```
use Frostybee\SwarmIcons\SwarmIcons;
use Frostybee\SwarmIcons\SwarmIconsConfig;

$manager = SwarmIconsConfig::create()
    ->discoverJsonSets()
    ->cachePath('/var/cache/icons')
    ->build();

SwarmIcons::setManager($manager);

echo swarm_icon('mdi:home', ['class' => 'w-6 h-6']);
// ...
```

You can also register local SVG directories or fetch from the Iconify API at runtime:

```
$manager = SwarmIconsConfig::create()
    ->addDirectory('custom', '/path/to/svgs')
    ->addIconifySet('heroicons')
    ->defaultAttributes(['class' => 'icon'])
    ->prefixAttributes('heroicons', ['stroke' => 'currentColor'])
    ->fallbackIcon('heroicons:question-mark-circle')
    ->build();
```

Documentation
-------------

[](#documentation)

For detailed guides on configuration, providers, CLI commands, framework integrations, and advanced options, visit the **[full documentation](https://frostybee.github.io/swarm-icons/)**.

Development
-----------

[](#development)

```
composer install
```

CommandDescription`composer test`Run PHPUnit tests`composer phpstan`Run PHPStan (level 8)`composer cs-check`Check code style (dry-run)`composer cs-fix`Auto-fix code style`composer test-all`PHPStan + CS check + testsLicense
-------

[](#license)

This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

73d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca21d8b863eb84452bbf22c312ae3d18e4da2461becbdbd58f046e15d18095cb?d=identicon)[frostybee](/maintainers/frostybee)

---

Top Contributors

[![frostybee](https://avatars.githubusercontent.com/u/805978?v=4)](https://github.com/frostybee "frostybee (41 commits)")

---

Tags

font-iconsiconify-iconsphp-iconsphp-svg-iconstwigiconssvgHeroiconsBootstrap Iconstabler-iconsPhosphorlucideiconifysimple-icons

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/frostybee-swarm-icons/health.svg)

```
[![Health](https://phpackages.com/badges/frostybee-swarm-icons/health.svg)](https://phpackages.com/packages/frostybee-swarm-icons)
```

###  Alternatives

[blade-ui-kit/blade-icons

A package to easily make use of icons in your Laravel Blade views.

2.5k34.2M309](/packages/blade-ui-kit-blade-icons)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

545.8M69](/packages/symfony-ux-icons)[asm89/twig-lint

Standalone twig linter.

1186.0M2](/packages/asm89-twig-lint)[twigstan/twigstan

TwigStan is a static analyzer for Twig templates powered by PHPStan

27412.1k](/packages/twigstan-twigstan)[sserbin/twig-linter

Standalone cli twig linter (based on symfony-bridge-twig)

13708.0k1](/packages/sserbin-twig-linter)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

1432.0k](/packages/symfony-ux-toolkit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
