PHPackages                             oscarotero/inline-svg - 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. oscarotero/inline-svg

ActiveLibrary

oscarotero/inline-svg
=====================

PHP library to embed svg in the html

v2.0.2(6y ago)1932.6k↓45.1%1[1 issues](https://github.com/oscarotero/inline-svg/issues)1MITPHPPHP &gt;=5.4.0

Since Mar 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/oscarotero/inline-svg)[ Packagist](https://packagist.org/packages/oscarotero/inline-svg)[ Docs](https://github.com/oscarotero/inline-svg)[ RSS](/packages/oscarotero-inline-svg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (1)

InlineSvg
=========

[](#inlinesvg)

PHP library to embed svg icons in the html pages so you can use css to change the style. Why do not use icon fonts? [Here a comparison svg vs fonts](http://css-tricks.com/icon-fonts-vs-svg/)

Requirements:
-------------

[](#requirements)

- PHP 5.4+
- [DOMDocument extension](http://php.net/DOMDocument) (enabled in PHP by default)

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

[](#installation)

This package is installable and autoloadable via Composer as [oscarotero/inline-svg](https://packagist.org/packages/oscarotero/inline-svg).

```
$ composer require oscarotero/inline-svg

```

Usage:
------

[](#usage)

```
use InlineSvg\Collection;
use InlineSvg\Transformers\Cleaner;

$icons = Collection::fromPath('path/to/svg/files');

//Add a cleaner transformer to remove ids
$icons->addTransformer(new Cleaner());

//Insert the svg code of the file 'edit.svg':
echo $icons->get('edit'); // get('edit')->withAttribute('class', 'big-icon'); // get('edit')->withA11y('The edit icon'); // The edit icon ..
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~400 days

Total

4

Last Release

2526d ago

Major Versions

v1.0.0 → v2.0.02016-07-21

### Community

Maintainers

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

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (11 commits)")

---

Tags

iconssvg

### Embed Badge

![Health badge](/badges/oscarotero-inline-svg/health.svg)

```
[![Health](https://phpackages.com/badges/oscarotero-inline-svg/health.svg)](https://phpackages.com/packages/oscarotero-inline-svg)
```

###  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)[twbs/bootstrap-icons

Official open source SVG icon library for Bootstrap

7.9k2.0M56](/packages/twbs-bootstrap-icons)[simple-icons/simple-icons

SVG icons for popular brands

24.8k194.2k4](/packages/simple-icons-simple-icons)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)[loganmarchione/homelab-svg-assets

Full-color SVG icons of homelab-related software, products, and brands

1.2k1.6k](/packages/loganmarchione-homelab-svg-assets)

PHPackages © 2026

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