Weave Code
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
Laravel Heroicons

Laravel Heroicons Laravel Package

archielite/laravel-heroicons

Laravel package to use Heroicons in your app, with easy icon rendering in Blade. Provides a simple way to include solid/outline icons as components, keeping SVGs organized and reusable across views.

View on GitHub
Deep Wiki
Context7

The Heroicons Blade Component

Frequently asked questions about Laravel Heroicons
How do I install Heroicons Blade Components in Laravel?
Run `composer require archielite/laravel-heroicons` to install the package. No additional configuration is required unless you’re using SVG sprites, which may need publishing via `php artisan vendor:publish --tag=heroicons-assets`. The package registers Blade components automatically.
What Laravel versions does this package support?
The package is designed for Laravel 8.x and 9.x, leveraging Blade components. Check the package’s `composer.json` for exact version constraints, as newer Laravel releases may introduce breaking changes to Blade syntax.
Can I use Heroicons dynamically (e.g., based on user roles)?
Yes, you can conditionally render icons using Blade’s native syntax. For example, `@if(auth()->user()->isAdmin()) <x-heroicons::icon name='shield-check' /> @endif`. For complex dynamic cases, extend the component with slots or custom logic.
Does this package work with Livewire or Alpine.js?
The package is Blade-centric and doesn’t natively integrate with Livewire or Alpine.js. For dynamic frontend interactions, consider using Heroicons via Alpine.js or a JavaScript-based solution like `@heroicons/react`.
How do I customize icon colors or sizes?
Apply Tailwind CSS or custom classes directly to the Blade component, e.g., `<x-heroicons::icon name='user' class='text-red-500 w-6 h-6' />`. The package renders raw SVGs, so standard CSS styling applies.
Will this package conflict with existing icon libraries like Font Awesome?
No direct conflicts exist, but ensure your asset pipeline (e.g., Vite) doesn’t duplicate or misroute SVG files. If using SVG sprites, verify no naming collisions occur with other icon systems.
Are there any performance concerns with using Blade components for icons?
Minimal overhead exists since the package renders static SVGs. For large-scale apps, benchmark rendering times in Blade vs. client-side solutions (e.g., Alpine.js). Blade components are ideal for server-rendered views with low dynamic complexity.
How do I handle missing or invalid icon names?
The package doesn’t include built-in error handling for invalid icon names. Validate inputs manually (e.g., `if (in_array($name, Heroicons::validIcons()))`) or wrap components in `@error` directives to gracefully handle failures.
Can I use Heroicons v1.x with this package?
The package likely targets Heroicons v2.x, which is the current stable release. Migrating from v1.x may require updating icon names (e.g., `user-o` → `user`). Check the package’s `CHANGELOG.md` for version-specific notes.
What’s the best way to test this package in a Laravel project?
Test in a non-production Blade view by rendering icons with different names, sizes, and conditions. Use Laravel’s `assertSee` in feature tests to verify SVG output. For edge cases, mock Blade components or use `collective/html` for testing helpers.
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.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views