outhebox/blade-feather-icons

一个易于在 Laravel Blade 视图中使用 Feather 图标的包。

v2.1.0 2021-08-28 09:24 UTC

README

Latest Stable Version Total Downloads

一个易于在 Laravel Blade 视图中使用 Feather 图标 的包。

要查看所有可用图标的完整列表,请参阅 SVG 目录 或在 feathericons.com 上预览。

要求

  • PHP 7.2 或更高版本
  • Laravel 7.14 或更高版本

安装

composer require outhebox/blade-feather-icons

使用

图标可以作为自闭合的 Blade 组件使用,将被编译为 SVG 图标

<x-feather-alert-triangle/>

您还可以向图标组件传递类

<x-feather-alert-triangle class="text-primary"/>

并且甚至可以使用内联样式

<x-feather-alert-triangle style="color: #555"/>

原始 SVG 图标

如果您想将原始 SVG 图标作为资源使用,可以使用以下命令发布它们

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

然后在视图中使用它们,如下所示

<img src="{{ asset('vendor/blade-feather-icons/alert-triangle.svg') }}" width="25" height="25"/>

更新您的 Feather 图标到最新版本

安装 feather icons npm 库

npm install feather-icons --save

然后将此行复制到您的 webpack.mix 文件中

mix.copy('node_modules/feather-icons/dist/icons', 'public/vendor/feather-icons');

Blade 图标

Blade Feather Icons 在底层使用 Blade 图标。有关附加功能,请参阅 Blade Icons 的 README

鸣谢

许可

Blade Feather Icons 是开源软件,许可协议为 MIT 许可协议