hyvor/php-svg-icons
PHP SVG Icons Library
Maintainers
1.1.0
2024-10-09 09:31 UTC
Requires
- php: ^8.1
- ext-simplexml: *
Requires (Dev)
- pestphp/pest: ^1.21
- phpstan/phpstan: ^1.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 9944d1e35e8f3d23972862178a9506f690ef251d
- Supun <supun.woop@hyvor.com>
This package is auto-updated.
Last update: 2026-06-09 12:59:29 UTC
README
Installation:
composer require hyvor/php-svg-icons
Format:
$icon = new Icon($library, $iconName); $svg = $icon->getSvg($width, $height);
Example:
$icon = new Icon('bootstrap', '123'); $icon->getSvg(); // 16x16 $icon->getSvg(20); // 20x20 $icon->getSvg(20, 25); // 20x25
Contributing
How to add a new icon library
- Create
icons/{library_name}folder with a.gitkeepfile in it - Add configuration to
src/libs.php - Create a fetcher in
src/Fetcher/{LibraryName}.php. See other fetchers to see how it works. Usually, you have to download the SVG icons from somewhere and add them to the icons folders.
Use php run.php to run all fetchers and update icons.
