|
| 1 | +# Blade Icons Template |
| 2 | + |
| 3 | +<a href="https://github.com/blade-organization/blade-heroicons/actions?query=workflow%3ATests"> |
| 4 | + <img src="https://github.com/blade-ui-kit/blade-heroicons/workflows/Tests/badge.svg" alt="Tests"> |
| 5 | +</a> |
| 6 | +<a href="https://packagist.org/packages/blade-organization/blade-heroicons"> |
| 7 | + <img src="https://img.shields.io/packagist/v/blade-organization/blade-heroicons" alt="Latest Stable Version"> |
| 8 | +</a> |
| 9 | +<a href="https://packagist.org/packages/blade-organization/blade-heroicons"> |
| 10 | + <img src="https://img.shields.io/packagist/dt/blade-organization/blade-heroicons" alt="Total Downloads"> |
| 11 | +</a> |
| 12 | + |
| 13 | +> This is a template repository for new icon packages for [Blade Icons](https://github.com/blade-ui-kit/blade-icons). Start a new repo with this and replace the relevant things below: |
| 14 | +> |
| 15 | +> 1. `blade-organization` with your GitHub organization |
| 16 | +> 2. `blade-heroicons` with your repository name |
| 17 | +> 3. `Blade Heroicons` & `Blade Icons Template` with your icon set name |
| 18 | +> 4. Any other reference to `Heroicons` with your icon set name |
| 19 | +> 5. `Blade Developer` with your name |
| 20 | +> |
| 21 | +> Then, make sure [the implementation](./src) is correct, that you set up [icon generation](https://github.com/blade-ui-kit/blade-icons#generating-icons) and that [your tests](./tests) pass. And remove this quote block from your readme. When you've published your package on Packagist, make sure to send it in to [the Blade Icons package list](https://github.com/blade-ui-kit/blade-icons#icon-packages). |
| 22 | +
|
| 23 | +A package to easily make use of [Heroicons](https://github.com/refactoringui/heroicons) in your Laravel Blade views. |
| 24 | + |
| 25 | +For a full list of available icons see [the SVG directory](resources/svg) or preview them at [heroicons.com](https://heroicons.com/). |
| 26 | + |
| 27 | +## Requirements |
| 28 | + |
| 29 | +- PHP 7.4 or higher |
| 30 | +- Laravel 8.0 or higher |
| 31 | + |
| 32 | +## Installation |
| 33 | + |
| 34 | +```bash |
| 35 | +composer require blade-organization/blade-heroicons |
| 36 | +``` |
| 37 | + |
| 38 | +## Updating |
| 39 | + |
| 40 | +Please refer to [`the upgrade guide`](UPGRADE.md) when updating the library. |
| 41 | + |
| 42 | +## Blade Icons |
| 43 | + |
| 44 | +Blade Heroicons uses Blade Icons under the hood. Please refer to [the Blade Icons readme](https://github.com/blade-ui-kit/blade-icons) for additional functionality. We also recommend to [enable icon caching](https://github.com/blade-ui-kit/blade-icons#caching) with this library. |
| 45 | + |
| 46 | +## Configuration |
| 47 | + |
| 48 | +Blade Heroicons 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-heroicons.php` config file: |
| 49 | + |
| 50 | +```bash |
| 51 | +php artisan vendor:publish --tag=blade-heroicons-config |
| 52 | +``` |
| 53 | + |
| 54 | +## Usage |
| 55 | + |
| 56 | +Icons can be used as self-closing Blade components which will be compiled to SVG icons: |
| 57 | + |
| 58 | +```blade |
| 59 | +<x-heroicon-o-adjustments/> |
| 60 | +``` |
| 61 | + |
| 62 | +You can also pass classes to your icon components: |
| 63 | + |
| 64 | +```blade |
| 65 | +<x-heroicon-o-adjustments class="w-6 h-6 text-gray-500"/> |
| 66 | +``` |
| 67 | + |
| 68 | +And even use inline styles: |
| 69 | + |
| 70 | +```blade |
| 71 | +<x-heroicon-o-adjustments style="color: #555"/> |
| 72 | +``` |
| 73 | + |
| 74 | +The solid icons can be referenced like this: |
| 75 | + |
| 76 | +```blade |
| 77 | +<x-heroicon-s-adjustments/> |
| 78 | +``` |
| 79 | + |
| 80 | +### Raw SVG Icons |
| 81 | + |
| 82 | +If you want to use the raw SVG icons as assets, you can publish them using: |
| 83 | + |
| 84 | +```bash |
| 85 | +php artisan vendor:publish --tag=blade-heroicons --force |
| 86 | +``` |
| 87 | + |
| 88 | +Then use them in your views like: |
| 89 | + |
| 90 | +```blade |
| 91 | +<img src="{{ asset('vendor/blade-heroicons/o-adjustments.svg') }}" width="10" height="10"/> |
| 92 | +``` |
| 93 | + |
| 94 | +## Changelog |
| 95 | + |
| 96 | +Check out the [CHANGELOG](CHANGELOG.md) in this repository for all the recent changes. |
| 97 | + |
| 98 | +## Maintainers |
| 99 | + |
| 100 | +Blade Heroicons is developed and maintained by Blade Developer. |
| 101 | + |
| 102 | +## License |
| 103 | + |
| 104 | +Blade Heroicons is open-sourced software licensed under [the MIT license](LICENSE.md). |
0 commit comments