PHPackages                             shaggyrec/php-svg-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. [Image &amp; Media](/categories/media)
4. /
5. shaggyrec/php-svg-icons

ActiveLibrary[Image &amp; Media](/categories/media)

shaggyrec/php-svg-icons
=======================

Svg icons api for php

1.0.2(6y ago)01.1k[1 PRs](https://github.com/shaggyrec/php-svg-icons/pulls)PHPCI passing

Since Dec 21Pushed 3w ago1 watchersCompare

[ Source](https://github.com/shaggyrec/php-svg-icons)[ Packagist](https://packagist.org/packages/shaggyrec/php-svg-icons)[ RSS](/packages/shaggyrec-php-svg-icons/feed)WikiDiscussions master Synced today

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

PHP SVG ICONS
=============

[](#php-svg-icons)

[![Build Status](https://camo.githubusercontent.com/521f7bed782952b165140b93bd1de55a0018d33528d58dd701f82c9194d86e15/68747470733a2f2f7472617669732d63692e6f72672f7368616767797265632f7068702d7376672d69636f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/shaggyrec/php-svg-icons)

### The library for providing svg icons to the php

[](#the-library-for-providing-svg-icons-to-the-php)

Install
-------

[](#install)

```
composer require shaggyrec/php-svg-icons

```

Usage
-----

[](#usage)

#### Get one icon:

[](#get-one-icon)

```
echo Shaggyrec\SvgIcons\icon('twitter');

```

#### Get all icons:

[](#get-all-icons)

```
echo Shaggyrec\SvgIcons\icons();

```

#### Find icons by name:

[](#find-icons-by-name)

```
echo Shaggyrec\SvgIcons\icons('twi');

```

#### Customize icons

[](#customize-icons)

```
echo Shaggyrec\SvgIcons\icon('twitter', '#fff', 24, 24);
echo Shaggyrec\SvgIcons\icons('twi', '#fff', 24, 24);

```

Documentation
=============

[](#documentation)

icon
----

[](#icon)

- params
    - \[0\] name (string, mandatory) - icon name
    - \[1\] color (string, optional) - set color
    - \[2\] width (int, optional) - set width
    - \[3\] height (int, optional) - set height
- returns the svg icon as string

icons
-----

[](#icons)

- params
    - \[0\] searchString (string, optional) - search string for icon name
    - \[1\] color (string, optional) - set color
    - \[2\] width (int, optional) - set width
    - \[3\] height (int, optional) - set height
- returns the array of `['name' => 'icon-name', 'value' => '
