Skip to content

Installation

Adding Blade Ionicons to a Laravel project takes a single Composer command. The package auto-registers itself, so most apps are done after step one. The optional steps below let you tune the package or publish the raw SVGs as static assets.

Requirements

Before you start, make sure your project meets these:

  • PHP 8.1 or higher
  • Laravel 10.0 or higher
LaravelPHPNotes
10.x8.1+Supported via illuminate/support ^10.0
11.x8.2+Supported via illuminate/support ^11.0
12.x8.2+Supported via illuminate/support ^12.0

The package also requires blade-ui-kit/blade-icons ^1.1, which Composer installs for you.

Step 1 — Install via Composer

Install the package from Packagist:

composer require faisal50x/blade-ionicons

Mind the vendor name

The Composer vendor is faisal50x (not foysal50x), so the full package name is faisal50x/blade-ionicons. The PHP namespace is Faisal50x\BladeIonicons, while the GitHub repository lives at github.com/Foysal50x/blade-ionicons.

Blade Ionicons uses Laravel's package auto-discovery, so its service provider registers itself — there is nothing to add to config/app.php. As soon as the package is installed, the ionicons set is registered with the ionicon component prefix and you can start using icons:

<x-ionicon-logo-apple class="w-6 h-6 text-gray-500" />

That is all most projects need. Continue to Usage to learn the component naming and styling options.

Step 2 (optional) — Publish the configuration

If you want to set a default prefix, apply default classes or attributes to every icon, or define a fallback icon, publish the config file:

php artisan vendor:publish --tag=blade-ionicons-config

This copies the package's defaults to config/blade-ionicons.php. Every option is documented in Configuration.

Step 3 (optional) — Publish the raw SVG icons

If you need the icons as plain files on disk — for example to reference one with an <img> tag — you can publish the raw SVGs to public/vendor/blade-ionicons:

php artisan vendor:publish --tag=blade-si

You can then reference any icon as a static asset:

<img src="{{ asset('vendor/blade-ionicons/logo-apple.svg') }}" width="24" height="24" />

Publish tag discrepancy

The package README documents this step as php artisan vendor:publish --tag=blade-ionicons --force, but the actual tag registered in the service provider is blade-si. Use --tag=blade-si--tag=blade-ionicons will not match any publishable group. (The maintainer plans to rename the tag to blade-ionicons in a future major release.) Add --force if you want to overwrite files you have already published.

Publishing the raw SVGs is entirely optional. For most use cases the self-closing components and the @svg directive are simpler — see Usage.

You're ready

The package is installed and the icon set is registered. Continue to Usage to render your first icons, or to Configuration to customize the defaults.

Blade Ionicons — Ionicons for Laravel Blade. Released under the MIT license.