项目作者: poldixd

项目描述 :
Use Feather Icons as a Blade include() or Blade Component in your Laravel application
高级语言: Blade
项目地址: git://github.com/poldixd/laravel-feather.git
创建时间: 2020-01-27T09:32:21Z
项目社区:https://github.com/poldixd/laravel-feather

开源协议:MIT License

下载


poldixd/laravel-feather

Use Feather Icons as a Blade include() or Blade Component in your Laravel 9.x or 10.x application. This Package uses Feather 4.28.0.

Installation

Simply require poldixd/larave-feather through Composer:

  1. composer require poldixd/laravel-feather

Usage

Include the icon like a Blade template in your view:

  1. <!-- Your Blade view -->
  2. @include('feather::airplay')
  3. <!-- Output: -->
  4. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>

Optional you can use Blade Components if you’re using laravel greater than 7.x.

  1. <!-- Your Blade view -->
  2. <x:feather-activity ></x:feather-activity>
  3. <!-- Output: -->
  4. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>

You can find a list of all icons on this website.

Using CSS Classes

You can include the icons with css classes.

  1. <!-- Your Blade view -->
  2. @include('feather::airplay', ['class' => 'my-awesome-class my-second-class'])
  3. <!-- or as a blade component -->
  4. <x:feather-activity class="my-awesome-class my-second-class" ></x:feather-activity>
  5. <!-- Output: -->
  6. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay my-awesome-class my-second-class"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>

Using Style attributes

  1. <!-- Your Blade view -->
  2. @include('feather::airplay', ['style' => 'color: red'])
  3. <!-- or as a blade component -->
  4. <x:feather-activity style="color: red" ></x:feather-activity>
  5. <!-- Output: -->
  6. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay" style="color: red"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>

License

poldixd/laravel-feather is licensed under the MIT License. The icons in this code are from Feather. It is also licensed under the MIT License.