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 Icons Laravel Package

driesvints/blade-icons

Blade Icons makes it easy to use any SVG icon set in your Laravel Blade views via components and directives like or @svg('camera'). Originally Blade SVG by Adam Wathan, it's the base for many third-party icon packages and supports custom icon sets.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Blade Icons is a thin view-layer package: a service provider that registers a config-driven icon-set registry, an @svg() directive, and anonymous <x-icon-*> Blade components that read SVG files from disk and inline them into the rendered HTML. No database, queue, cache backend, or external service dependency.
  • It fits any application whose UI is server-rendered by Blade (classic Laravel monolith, Livewire, Blade + Alpine). It is not a fit for API-only services, or for Inertia/React/Vue front-ends where icons belong in the JS bundle — there the package adds a dependency with zero surface area.
  • The correct architectural framing for a TPM: this is a design-system delivery mechanism, not a feature. Its value comes from standardising how icons enter the DOM (naming, sizing, accessibility defaults), which is a governance decision you own, not something the package decides for you.

Integration feasibility

  • Genuinely small: composer require blade-ui-kit/blade-icons, publish and uncomment the default set in config/blade-icons.php, drop SVGs into resources/svg. A mid-level Laravel developer is productive in under a day; a first page shipped in an afternoon.
  • Optional icon-set packages (Heroicons, Lucide, Tabler, Font Awesome, Material Symbols, and ~90 others) install the same way, so scaling coverage is a config change rather than engineering work.

Technical risk — low overall, with four real hazards

  1. XSS surface. The package emits SVG file contents into the page. Any user-uploaded or CMS-authored SVG must be sanitised upstream; do not treat this as a safe rendering path for untrusted content.
  2. Silent or loud failure asymmetry. <x-icon-missing> (unknown component) throws at render; @svg('missing') can degrade quietly. Without a guard rail you discover breakage in production, not CI.
  3. Tailwind interaction. Utility classes inside SVG files are invisible to Tailwind's content scanner unless resources/svg/**/*.svg is added to tailwind.config.js content paths. This is the single most common "works locally, broken in prod" bug with this package.
  4. Ecosystem supply chain. The base package is high-quality; many of the ~90 third-party icon-set packages are single-maintainer, low-traffic repos. Treat each as a separate dependency review.
  • Note the data discrepancy: the "Dependents: 0" figure is inconsistent with the package's documented role as the base for the entire Blade icon-set ecosystem. Verify via Packagist/GitHub before using that number in any build-vs-buy argument.

Key questions

  • Which surfaces render icons — Blade only, or is there an SPA that needs a parallel JS icon story?
  • Who owns icon curation (design system team vs. feature teams), and what is the allowlist policy for adding a new set?
  • Will icon names ever be data-driven (CMS/DB-driven)? If so, we need an allowlist/validation layer.
  • What are the licences of the chosen icon sets (attribution, redistribution in a commercial product)?
  • What is our deploy-time cache strategy (icons:cache / config cache) and who owns cache invalidation when icons change?
  • Do we need a missing-icon fallback and an alert, or is a hard exception acceptable?

Integration Approach

Stack fit

  • Requirements are PHP 7.4+ / Laravel 8+; on a current Laravel 11/12 + PHP 8.2+ codebase there is no constraint. It layers cleanly under existing Blade component libraries and passes through class attributes, so Tailwind sizing/spacing conventions carry over.
  • Where the app already has a shared <x-icon> component, the package becomes the implementation detail behind it — that is the recommended shape for anything beyond a small app.

Migration path

  1. Inventory first. Grep the codebase for existing icon usage (font-icon classes, <img src="*.svg">, inline <svg> blocks) and produce a frequency table. Most apps use 30–60 distinct icons out of thousands; do not import an entire set because it is convenient.
  2. Introduce alongside, not instead of. Install the package, register one set, and create one app-level wrapper (<x-icon name="camera" />) that enforces aria-hidden, a default size scale, and a fallback. All new code uses the wrapper; the wrapper shields you from ever calling the vendor component directly.
  3. Migrate by surface area. Convert navigation and shared layout first (highest reuse, lowest count), then feature pages. Retire the icon font / <img>-based approach only once usage drops to zero — that is when you collect the payload savings.
  4. Clean up the old path. Remove the icon font CSS/webfont files, update the CSP if the old approach needed one, and record the removed kilobytes as the delivered benefit.

Compatibility

  • Watch for config/blade-icons.php publishing collisions and for namespace clashes if the app already defines an <x-icon> component.
  • Add resources/svg/**/*.svg to Tailwind content paths at the same time as the install — not afterwards.
  • Ensure deploy pipelines run php artisan config:cache and the icon manifest cache command after assets/icons are in place; stale manifests are the #1 "works on my machine" report for this package.

Sequencing Spike (½ day) → license and icon-set decision → config + wrapper component → Tailwind/CI changes → pilot page → phased migration → legacy icon-font removal → documented icon policy. Budget roughly one developer-week end-to-end for a mid-size app, with the bulk spent on migration breadth and design review, not on the package itself.

Operational Impact

Maintenance

  • MIT licensed, active releases, changelog and CI workflows (tests, coding standards) present — a good maturity signal for a utility of this size. Churn is low; expect routine version bumps rather than migrations.
  • Bus factor is the honest concern: a single primary maintainer (a Laravel core team member, which mitigates but does not eliminate the risk). Pin to a major version and review release notes on upgrade. The package is small enough to fork or vendor as a contingency if maintenance ever stalls; budget ~1 day for that fallback, and note it as accepted risk rather than a blocker.

Support

  • Community-only GitHub issues, no SLA, no commercial backing. Acceptable for internal tools and most commercial apps; for client contracts with uptime guarantees, document the fork/vendor contingency in the risk register.

Scaling

  • Rendering is per-request file resolution unless the icon manifest is cached — enable caching and warm it in deploy. Cache the config in all non-local environments.
  • Output scales linearly with icons per page because SVGs are inlined. Pages with 100+ icons (data tables, dashboards) will measurably inflate HTML payload; consider an SVG sprite or cached partial for those specific screens rather than abandoning the package.
  • Repository/deploy artifact size grows by the size of the imported sets (single-digit MB at most) — irrelevant for typical container deploys, worth a glance if you are on Lambda or size-capped artifacts.

Failure modes to instrument

  • Missing icon → exception (component) or silent blank (@svg); add a render smoke test over key routes and a fallback icon.
  • Stale config/manifest cache after deploy → icons vanish or 500s; make cache warmup a pipeline step, not a manual runbook item.
  • Path misconfiguration (resources/svg absent) → boot-time failure; assert the directory exists in a health check.
  • Tailwind purge stripping classes declared inside SVG files → unstyled icons in production only; verify in a production-mode build, not just dev.
  • Unsanitised SVG from user content → stored XSS; enforce sanitisation at the upload boundary.
  • Icon-set package rename/removal or licence change upstream → template references break; pin versions and keep the wrapper component as the single rename point.

Ramp-up

  • Individual developer: hours. Team: one short doc covering the wrapper component, the approved set, the size scale, and the a11y defaults — plus a dev-only route listing available icons, which prevents both duplicate imports and ad-hoc inline SVGs creeping back in. The TPM's real deliverable here is the icon policy and the CI guard rails; the package itself is a solved problem.
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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow