Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Blade Fontawesome

Blade Fontawesome Laravel Package

owenvoke/blade-fontawesome

Blade Font Awesome lets you drop Font Awesome icons into any Laravel Blade view as simple self-closing components like . Pass classes or inline styles, configure default prefixes, and publish raw SVGs. Requires PHP 8.3+ and Laravel 12+, with Font Awesome 7.

View on GitHub
Deep Wiki
Context7

Blade Font Awesome integrates the full Font Awesome 7 icon library directly into Laravel Blade views as self-closing SVG components. Render any icon with a simple tag like <x-fas-cloud/>, then add classes (class="w-6 h-6 text-gray-500") or inline styles for full styling control. Requires PHP 8.3+ and Laravel 12.x+.

It supports all free sets (Brands, Regular, Solid) plus pro sets like Duotone, Light, Thin, and every Sharp variant, with configurable prefixes and a publishable config file for defaults.

  • Zero-config install via Composer; icons compile to inline SVG
  • Free and pro icon sets, each individually enable/disable-able
  • Customizable default classes and attributes
  • Publish raw SVG assets for use outside Blade
  • Upgrade guide and versioned docs for 1.x/2.x users
Frequently asked questions about Blade Fontawesome
How do I install owenvoke/blade-fontawesome in a Laravel app?
Run composer require owenvoke/blade-fontawesome in your Laravel project. The service provider is auto-discovered, so there is no manual registration step. If you want to change default classes or attributes, publish the config file with php artisan vendor:publish --tag=blade-fontawesome-config. No npm install or asset build is needed for the Free icon sets.
Which Laravel and PHP versions does Blade Font Awesome support?
Version 3.x requires PHP 8.3 or higher and Laravel 12.x or higher, and it ships Font Awesome 7 icons. If you are still on Laravel 10 or 11, or you need Font Awesome 6, pin the 2.x release instead, which has its own documentation. Laravel 13.x support landed in 3.2.0 and the Font Awesome source is bumped by automated updates, so the package tracks both the framework and the icon set. Treat the PHP and Laravel floor as a hard gate and plan the upgrade before adoption.
How do I use a Font Awesome icon in a Blade view?
Icons are rendered as self-closing Blade components named after the icon set prefix and the icon name, for example <x-fas-cloud /> for a Solid cloud. The prefixes are fab for Brands, far for Regular and fas for Solid. Because the output is inline SVG, normal HTML attributes such as class and style can be passed straight to the component. Rendering happens server-side, so icons work anywhere Blade renders, including Livewire partials.
How do I add custom classes or inline styles to an icon?
Pass a class attribute for utility classes such as w-6 h-6 text-gray-500, or a style attribute for inline CSS like color: #555. The generated SVG uses currentColor, so icons inherit your existing text colour and design tokens without any Font Awesome CSS classes. For values you repeat everywhere, publish the config file and set default classes and default attributes once so every icon picks them up.
Does this package load Font Awesome from a CDN or ship the webfont CSS?
Neither. The package ships the Font Awesome SVG source tree and compiles each icon into inline SVG at render time, so there is no webfont request, no third-party origin in the critical path and no font-src exception needed in your Content Security Policy. That also removes the flash of unstyled text and avoids loading roughly 100KB-plus of Font Awesome CSS and font files. The trade-off is HTML weight, because the SVG markup is repeated for every icon on the page.
How do I enable the Font Awesome Pro icon sets?
Pro and Kit sets require the licensed Font Awesome packages installed via npm, either @fortawesome/fontawesome-pro or an @awesome.me/kit-* package, plus an Artisan sync command that writes icons into resources/icons/blade-fontawesome. Each Pro prefix such as fad, fal, fat, fak or the sharp variants can then be enabled or disabled in the blade-fontawesome config file, for example by setting sharp-regular to false. Only take this path if you hold a Font Awesome Pro licence, since it adds Node and private registry credentials to your build and CI pipeline.
Can I render icons whose names come from a database or user settings?
Yes. Build the component name at runtime and render it with Laravel's <x-dynamic-component :component="$name" />, or call the underlying svg() helper from blade-ui-kit/blade-icons. Both approaches keep the inline SVG output while letting icon names come from a database, config or user preferences. Design this once as a small wrapper component rather than scattering dynamic names through views, and whitelist the allowed icon names instead of trusting user input blindly.
Can I publish the raw SVG files as assets?
Yes. Running php artisan vendor:publish --tag=blade-fontawesome --force copies the raw SVG files so you can reference them as static assets, use them inside CSS or serve them from storage. Use the force flag carefully because it overwrites previously published files. Most applications do not need this step, since the Blade components already render the same SVGs inline.
Is Blade Font Awesome free to use in a commercial project?
The code is MIT licensed, but the README carries a Treeware rider asking production users to buy a tree. It is an honour-system request rather than a licence condition, but it is inexpensive and worth clearing with procurement up front so it is not discovered later. Development and non-production use are unaffected.
What are the alternatives to owenvoke/blade-fontawesome?
The package is a thin wrapper around blade-ui-kit/blade-icons, so one option is to depend on blade-icons directly and register your own SVG icon set. Other Blade icon packages, such as Heroicons or Tabler wrappers, follow the same pattern and may suit teams that are not committed to Font Awesome. If part of your product is a Vue, React or Inertia front end, you will need a JavaScript icon library anyway, because this package only adds value inside Blade views.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo