PHPackages                             spaze/svg-icons-latte - 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. spaze/svg-icons-latte

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

spaze/svg-icons-latte
=====================

SVG Icons Custom Tag for Latte Templating System

v1.1.0(1mo ago)320MITPHPPHP ^8.1CI passing

Since Oct 25Pushed 3d ago1 watchersCompare

[ Source](https://github.com/spaze/svg-icons-latte)[ Packagist](https://packagist.org/packages/spaze/svg-icons-latte)[ RSS](/packages/spaze-svg-icons-latte/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (18)Versions (9)Used By (0)

SVG Icons Custom Tag for Latte Templating System
================================================

[](#svg-icons-custom-tag-for-latte-templating-system)

The custom `{icon}` tag will embed an SVG icon loaded from an external file.

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

[](#installation)

```
composer require spaze/svg-icons-latte

```

Requires PHP 8.1+

Register the Nette extension, e.g.:

```
extensions:
	svgIcons: Spaze\SvgIcons\NetteExtension
```

This will also auto-register the Latte extension itself.

Configuration
-------------

[](#configuration)

```
svgIcons:
	iconsDir: '../../node_modules/humbleicons/icons'
	cssClass: 'humbleicons'
```

- `iconsDir` is a path to a directory with SVG icon files, for example [Humbleicons](https://humbleicons.com/) by [@Zraly](https://twitter.com/zraly) (required)
- `cssClass` defines a CSS class that will be added to the root `` element (optional)

Usage in Latte
--------------

[](#usage-in-latte)

`{icon wifi}` will be replaced with the contents loaded from `wifi.svg` located in `iconsDir`.

You can also add extra CSS classes: `{icon wifi class => foo, class => bar}` will add additional CSS classes `foo` and `bar` to the root `` element.

Given the configuration above, the resulting tag would look like ``.

Usage in PHP
------------

[](#usage-in-php)

Use `Spaze\SvgIcons\SvgIcons::getSvg(string $icon): string` to get the icon SVG in PHP, if you for example want to embed the SVG in an email message where Latte is not available. Pass the icon name without the `.svg` extension as the `$icon` parameter, for example `wifi`, not `wifi.svg`.

The `SvgIcons` class uses the directory set in configuration and appends `.svg` to load the file contents.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance96

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 87.9% 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 ~216 days

Recently: every ~285 days

Total

7

Last Release

44d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6777bd445610e6e458e4d41bdefa3070d2ed4e068323362353b061b15e9ff81b?d=identicon)[spaze](/maintainers/spaze)

---

Top Contributors

[![spaze](https://avatars.githubusercontent.com/u/1966648?v=4)](https://github.com/spaze "spaze (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spaze-svg-icons-latte/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[contributte/translation

Symfony/Translation integration for Nette Framework.

771.8M49](/packages/contributte-translation)

PHPackages © 2026

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