brunocfalcao / blade-feather-icons
A package to easily make use of Feather Icons in your Laravel Blade views.
Installs: 691 952
Dependents: 8
Suggesters: 1
Security: 0
Stars: 36
Watchers: 1
Forks: 14
Open Issues: 0
pkg:composer/brunocfalcao/blade-feather-icons
Requires
- php: ^8.4
- blade-ui-kit/blade-icons: ^1.0
- illuminate/support: ^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- orchestra/testbench: ^10.6
- pestphp/pest: ^4.0
- dev-master
- v6.0
- v5.0.0
- v4.0.0
- v3.0.0
- v2.1.0
- v2.0.1
- 2.0.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- v0.2.0
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-dependabot/npm_and_yarn/pbkdf2-3.1.3
- dev-dependabot/npm_and_yarn/cipher-base-1.0.6
- dev-dependabot/npm_and_yarn/sha.js-2.4.12
- dev-dependabot/npm_and_yarn/multi-d74e9e8b49
- dev-dependabot/npm_and_yarn/multi-96c788614a
- dev-dependabot/npm_and_yarn/elliptic-6.6.1
- dev-dependabot/npm_and_yarn/multi-db17b8dbde
- dev-dependabot/npm_and_yarn/browserify-sign-4.2.3
- dev-dependabot/npm_and_yarn/multi-071be8b608
- dev-dependabot/npm_and_yarn/ws-6.2.3
- dev-dependabot/npm_and_yarn/multi-00775cc1dc
- dev-dependabot/npm_and_yarn/multi-8a19c61169
- dev-dependabot/npm_and_yarn/qs-and-express-6.11.0
- dev-dependabot/npm_and_yarn/minimist-1.2.8
- dev-dependabot/npm_and_yarn/minimatch-3.1.2
- dev-dependabot/npm_and_yarn/ansi-html-and-webpack-dev-server--removed
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/eventsource-1.1.1
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
This package is auto-updated.
Last update: 2025-11-07 21:02:06 UTC
README
A Laravel package to easily use Feather Icons in your Blade views as inline SVG components.
For a full list of available icons, see the SVG directory or preview them at feathericons.com.
โจ Features
- ๐จ 287+ Beautiful Icons - Simple, consistent, open-source icons
- ๐ Zero Dependencies - No JavaScript required, pure inline SVG
- ๐ Laravel Integration - Native Blade component syntax
- ๐ฏ Full Control - Add classes, styles, and attributes easily
- โก Performance - Cached and optimized SVG rendering
- ๐ง Customizable - Tailwind CSS and any CSS framework compatible
- ๐ NPM Sync Command - Keep icons updated from official Feather Icons releases
๐ Requirements
- PHP: 8.4 or higher
- Laravel: 12.0 or higher
- blade-ui-kit/blade-icons: ^1.0
๐ฆ Installation
Install the package via Composer:
composer require brunocfalcao/blade-feather-icons
The package will automatically register itself via Laravel's package auto-discovery.
๐ Usage
Basic Usage
Icons can be used as self-closing Blade components:
<x-feathericon-heart /> <x-feathericon-alert-triangle /> <x-feathericon-activity />
Adding Classes
Perfect for Tailwind CSS or any CSS framework:
<x-feathericon-heart class="w-6 h-6 text-red-500" /> <x-feathericon-mail class="h-4 w-4 text-gray-600" />
Adding Inline Styles
<x-feathericon-star style="color: #FFD700; width: 32px; height: 32px;" />
Adding Multiple Attributes
<x-feathericon-check-circle class="w-5 h-5 text-green-500" aria-hidden="true" data-icon="success" />
Using with Alpine.js
<button @click="liked = !liked"> <x-feathericon-heart class="w-5 h-5" ::class="liked ? 'text-red-500 fill-current' : 'text-gray-400'" /> </button>
Common Examples
{{-- Navigation --}} <nav> <a href="/dashboard"> <x-feathericon-home class="w-5 h-5" /> Dashboard </a> <a href="/settings"> <x-feathericon-settings class="w-5 h-5" /> Settings </a> </nav> {{-- Buttons --}} <button class="btn"> <x-feathericon-download class="w-4 h-4 mr-2" /> Download </button> {{-- Alerts --}} <div class="alert alert-warning"> <x-feathericon-alert-triangle class="w-5 h-5" /> <span>Warning message here</span> </div> {{-- Loading States --}} <x-feathericon-loader class="w-6 h-6 animate-spin text-blue-500" />
๐จ Available Icons
All 287 Feather icons are available. Common icons include:
Interface: home, menu, x, check, chevron-down, chevron-up, arrow-right, arrow-left, more-vertical, more-horizontal
Media: play, pause, volume, volume-x, music, video, image, camera, film
Communication: mail, message-circle, phone, at-sign, bell, send
Files: file, folder, download, upload, save, trash, edit, copy
Social: heart, star, thumbs-up, share, bookmark
E-commerce: shopping-cart, credit-card, dollar-sign, tag
Status: check-circle, x-circle, alert-circle, alert-triangle, info, help-circle
System: settings, user, lock, unlock, eye, eye-off, search, filter
๐ง Publishing Assets (Optional)
If you need the raw SVG files as static assets:
php artisan vendor:publish --tag=blade-feather-icons --force
This will publish the icons to public/vendor/feather-icons/.
Then use them in your views:
<img src="{{ asset('vendor/feather-icons/heart.svg') }}" width="24" height="24" alt="Heart" />
Note: This is rarely needed. Using Blade components (default) is recommended for better performance and control.
๐ Syncing Icons from NPM
Want to keep your icons up-to-date with the latest Feather Icons releases? You can sync SVG files directly from the npm package.
Prerequisites
First, install the official Feather Icons npm package in your project:
npm install feather-icons --save-dev
Sync Command
Run the sync command to update your package's SVG files:
php artisan feathericons:sync
This will:
- โ
Copy all icons from
node_modules/feather-icons/dist/iconsto the package - โ Detect new, updated, and unchanged icons
- โ Display a detailed progress report
Dry Run
Preview changes without actually copying files:
php artisan feathericons:sync --dry-run
Example output:
Syncing Feather Icons...
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ 100%
Total icons .......... 287
Would be added ....... 5
Would be updated ..... 12
Unchanged ............ 270
Run without --dry-run to apply these changes.
Custom NPM Path
If your node_modules is in a non-standard location:
php artisan feathericons:sync --npm-path=/custom/path/to/project
When to Sync
- ๐ฆ After updating the
feather-iconsnpm package - ๐ When new icons are released by Feather Icons
- ๐ง If you manually modified icons and want to revert to originals
Note: This is a unique feature not available in other Blade icon packages! It gives you full control over your icon versions.
๐งช Testing
The package includes comprehensive Pest tests:
composer test
Run tests with coverage:
composer test-coverage
๐ Advanced Usage
Using the Helper Function
You can also use the svg() helper function:
{!! svg('feathericon-heart', 'w-6 h-6 text-red-500') !!}
With multiple attributes:
{!! svg('feathericon-star', ['class' => 'w-6 h-6', 'style' => 'color: gold']) !!}
Custom Prefix
If you want to change the default feathericon- prefix, you can extend the service provider in your own application.
Blade Icons Features
This package is built on top of Blade Icons. You can use all Blade Icons features:
๐ Troubleshooting
Icons not showing?
- Make sure you've installed the package:
composer require brunocfalcao/blade-feather-icons - Clear Laravel's cache:
php artisan view:clear && php artisan cache:clear - Check your icon name matches the filename in
resources/svg/
Wrong icon name?
Icon names use kebab-case. For example:
alert-triangle.svgโ<x-feathericon-alert-triangle />arrow-up-right.svgโ<x-feathericon-arrow-up-right />
Using with Livewire?
Blade Feather Icons works perfectly with Livewire. Just use the components as normal:
<div> @if($isActive) <x-feathericon-check-circle class="w-5 h-5 text-green-500" /> @else <x-feathericon-x-circle class="w-5 h-5 text-red-500" /> @endif </div>
๐ Changelog
Please see CHANGELOG for recent changes.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐จโ๐ป Maintainers
Blade Feather Icons is developed and maintained by Bruno Falcao.
Blade Icons is developed and maintained by Dries Vints.
Feather Icons is created by Cole Bemis.
๐ License
Blade Feather Icons is open-sourced software licensed under the MIT license.
Feather Icons is also licensed under the MIT license.
๐ Related Packages
- Blade Icons - The foundation for this package
- Blade Heroicons - Heroicons for Laravel
- Blade Font Awesome - Font Awesome for Laravel
Love this package? Give it a โญ๏ธ on GitHub and follow @brunocfalcao on Twitter!