wrdx/heroicons

Generate svg icons from heroicons.com with PHP

v1.0.1 2024-02-06 20:55 UTC

This package is auto-updated.

Last update: 2024-04-06 21:35:57 UTC


README

php 8.1-8.3

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