Blade Icons

blade-ui-kit/blade-icons image

Blade Icons stats

Downloads
5.4M
Stars
1,888
Open Issues
1
Forks
128

View on GitHub →

A package to easily make use of icons in your Laravel Blade views.

Blade Icons

Blade Icons is a versatile Laravel package designed to simplify the integration and management of SVG icons within Laravel Blade views. It is a refined evolution of "Blade SVG" originally developed by Adam Wathan.

Key Features

  • Ease of Use: Convert verbose SVG HTML markup into clean Blade component tags or directives.
  • Extensive Icon Support: Compatible with a broad range of third-party icon sets, thanks to community contributions.
  • Caching: Includes a caching mechanism to enhance performance when dealing with large icon sets.
  • Flexible Configuration: Supports custom icon sets, default classes, attributes, prefixes, and multi-path icons.
  • Component and Directive Options: Use Blade components or directives based on preference.
  • Fallback Icons: Specify fallback icons to ensure graceful handling of missing icons.

Installation

  1. Install via composer:
    composer require blade-ui-kit/blade-icons
  2. Publish the configuration file:
    php artisan vendor:publish --tag=blade-icons
    Ensure to uncomment and verify the default icon set path in the published config, typically pointing to resources/svg.

Usage

Blade Icons can be used in various ways including:

  • Blade Components, simplifying syntax to:
    <x-icon-camera class="w-6 h-6"/>
  • Directives, allowing for:
    @svg('camera', 'w-6 h-6')
  • Helper Functions, for a fluent syntax:
    {{ svg('camera')->class('w-6 h-6') }}

Configuration

To customize icon sets, classes, attributes, or prefixes, modify the blade-icons.php in your config directory. You can define multiple icon sets with custom paths or even use external storage disks like AWS S3.

Caching

To cache icons for production, use:

php artisan icons:cache

This optimizes performance by creating a manifest of all icon sets and their paths.

Building Custom Icon Packages

For those interested in extending functionality with custom icons, Blade Icons offers a straightforward approach to create and register new icon packages, utilizing a template repository for ease of setup.

Requirements

  • PHP 7.4 or higher
  • Laravel 8.0 or higher

Maintainers

Developed and maintained by Dries Vints, with the package open for contributions from the community.

License

Blade Icons is released under the MIT license, ensuring it is free to use and modify.

This package not only simplifies the management and deployment of icons across Laravel applications but also encourages best practices with its flexible and developer-friendly API.

blade-ui-kit photo

A set of open-source libraries built for Laravel Blade.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Blade Ui Kit Blade Icons Related Articles

Laravel Blade Country and Language Icons image

Laravel Blade Country and Language Icons

Read article
Laravel Blade Icons Stable Release image

Laravel Blade Icons Stable Release

Read article
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit