Skip to content

A package to easily make use of Health Icons in your Laravel Blade views

License

Notifications You must be signed in to change notification settings

troccoli/blade-health-icons

Repository files navigation

Social Card Blade Health Icons

Blade Health Icons

Tests StyleCI Packagist Version Packagist Downloads

A package to easily make use of Health Icons in your Laravel Blade views.

For a full list of available icons see the SVG directory or preview them at healthicons.org.

Requirements

  • PHP 8.1 or higher
  • Laravel 10.0 or higher

Installation

composer require troccoli/blade-health-icons

Blade Icons

Blade Healthicons uses Blade Icons under the hood. Please refer to the Blade Icons readme for additional functionality. We also recommend to enable icon caching with this library.

Configuration

Blade Healthicons also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the blade-health-icons.php config file:

php artisan vendor:publish --tag=blade-health-icons-config

Usage

Health Icons provides two types of icons: filled and outlined.

Once you have found the icon you want to use on their site, click on it and make a note of the filename. The name of the icon to use will be the filename, where you replace the underscore with dashes. For example, the Blood A- icon's filename is blood_a_n, so the name for the icon will be blood-a-n.

Icons can be used as self-closing Blade components which will be compiled to SVG icons:

<x-healthicons-o-blood-a-n/>

You can also pass classes to your icon components:

<x-healthicons-o-blood-a-n class="w-6 h-6 text-gray-500"/>

And even use inline styles:

<x-healthicons-o-blood-a-n style="color: #555"/>

The filled icons can be referenced like this:

<x-healthicons-f-blood-a-n/>

Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

php artisan vendor:publish --tag=blade-health-icons --force

Then use them in your views like:

<img src="{{ asset('vendor/blade-health-icons/o-blood-a-n.svg') }}" width="10" height="10"/>

Changelog

Check out the CHANGELOG in this repository for all the recent changes.

Maintainers

Blade Healthicons is developed and maintained by Giulio Troccoli-Allard.

License

Blade Healthicons is open-sourced software licensed under the MIT license.