wrdx / heroicons
Generate svg icons from heroicons.com with PHP
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
pkg:composer/wrdx/heroicons
Requires
- php: ^8.1
- ext-simplexml: *
- meyfa/php-svg: ^0.14.7
Requires (Dev)
- ext-mbstring: *
- pestphp/pest: ^2.33
- symfony/var-dumper: ^6.4
README
Installation
Install the package via composer
composer require wrdx/heroicons
Usage
use Wrdx\Heroicons\Hero; echo Hero::icon('academic-cap')->svg();
A bit more control
use Wrdx\Heroicons\Hero; use Wrdx\Heroicons\Enums\Type; $icon = new Hero('academic-cap'); $icon->type(Type::micro); $icon->class('my-class', 'my-second-class'); $icon->attr('id','my-id'); echo $icon->svg();
Use the heroicon()
helper function
use Wrdx\Heroicons\Enums\Type; echo heroicon('academic-cap', Type::mini, ['id' => 'my-id']);
Development
Run tests
composer test
Update heroicons.com svg files
composer heroicons:update