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

Bootstrap Icons Laravel Package

twbs/bootstrap-icons

Official open source SVG icon library for Bootstrap, offering over 2,000 free, MIT-licensed icons. Install via npm (bootstrap-icons) or Composer, then use as embedded HTML, img tags, an SVG sprite, or CSS. Also available in Figma.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit twbs/bootstrap-icons is a content-only distribution package: ~2,000 optimized 16×16 SVGs plus derived artifacts (icon font in woff2/woff, bootstrap-icons.svg sprite, bootstrap-icons.css/.scss). It ships no PHP, no service provider, no config, no autoload entry. It is published to Packagist purely as a file carrier alongside npm. That makes it a near-perfect fit for a Laravel app's presentation layer and a poor fit for any team expecting a framework-integrated API (facade, Blade directives, config-driven icon sets). The correct mental model is "a vendored design asset with a version number," not "a library we integrate."

Architecturally it slots in cleanly at three seams:

  • Blade/SSR — inline SVG via a wrapper component reading vendor/twbs/bootstrap-icons/icons/{name}.svg.
  • Vite asset pipeline — import the shipped CSS or copy the sprite into public/.
  • CDN edge — jsDelivr CSS or self-hosted sprite, no build coupling at all.

It is framework- and CSS-agnostic: it does not require Bootstrap 5 CSS to be present, so it can be dropped into a Tailwind, Livewire, or Inertia app without dragging in the Bootstrap grid.

Integration feasibility High. Four viable paths, ordered by operational cost:

  1. Inline SVG Blade component (recommended) — <x-bi name="alarm" /> reads the SVG via file_get_contents(base_path('vendor/twbs/bootstrap-icons/icons/…')). Zero external requests, full CSS currentColor control, per-icon tree-shaking by construction, CSP-friendly.
  2. blade-ui-kit/blade-icons with a custom icon set — register a class pointing at the vendor icons/ path; you get <x-icon-bootstrap-alarm />, built-in caching, and a consistent API across multiple icon sets. Best choice if the app already standardizes on blade-icons.
  3. SVG sprite — publish bootstrap-icons.svg to public/ and use <svg><use href="/icons.svg#alarm"/></svg>. One cached HTTP request, good for icon-dense UIs, but <use> has styling and shadow-DOM quirks and can't easily hold per-instance titles.
  4. Icon font via CSS — <i class="bi bi-alarm"></i>. Fastest to adopt, worst a11y (pseudo-element content, no accessible name), adds a font payload regardless of icon count, and breaks under restrictive font-src CSP.

Technical risk

  • Icon-name churn without major-version bumps (highest risk). Releases confirm renames inside minor versions: cassette* renamed in v1.9.1, building → buildings in v1.10.0. SemVer here tracks repo changes, not slug stability. A routine composer update can silently blank an icon in production.
  • Path-traversal / injection if the icon name is dynamic. Any component that interpolates a user- or CMS-supplied name into a vendor file path must validate against an allowlist of filenames. Never echo raw SVG through {!! !!} without an allowlisted name.
  • Vendor path is not web-accessible. public/ symlinks or blind asset('vendor/…') assumptions will 404. Anything served directly must be explicitly published or copied at build time.
  • Brand-mark trademarks. The set includes Chrome, Firefox, Safari, Edge, Ubuntu, Dropbox, Yelp, Alipay, WeChat, Microsoft Teams, Google Play. MIT covers the asset; it does not grant trademark usage rights. Shipping third-party logos in a commercial product is a legal review item independent of the license.
  • Metadata anomalies in this evaluation. Dependents: 0 is implausible for an official Bootstrap package and almost certainly a Packagist counting artifact; Last release: 2026-10-08 post-dates the newest changelog content (v1.10.5) in the same source set. Both should be treated as scoring-pipeline noise and re-verified against Packagist/npm before pinning. The opportunity score of 47.52 correctly reflects low strategic upside — this is a commodity "buy, don't build" decision whose value is avoided design/labor cost, not differentiation.
  • Single-maintainer concentration (@mdo) is mitigated by the Bootstrap org, 8.1k stars, documented release automation, and MIT re-forkability.

Key questions

  1. Rendering mode: inline SVG, sprite, or font? This decision locks in bundle size, a11y posture, and CSP requirements.
  2. Does the UI need all icons available at runtime, or a fixed inventory we can enumerate at build time?
  3. Is there a CSP today? If yes, does it permit inline SVG and what is the font-src directive?
  4. What is the incumbent icon set (Font Awesome, Heroicons, custom)? A name-map must be authored before migration — automated fa-* → bi-* mapping will silently miss glyphs with no equivalent.
  5. Who owns icon-name stability across dependency bumps, and is there a CI gate?
  6. Are brand logos needed in shipped UI, and has legal signed off?
  7. Do we need RTL mirroring? Bootstrap Icons provides directional glyphs but no automatic mirroring behavior.
  8. Self-host or CDN, and does that survive our CSP, GDPR, and air-gapped/staging constraints?

Integration Approach

Stack fit Excellent for Laravel 9–11 (Vite), Laravel 8 (Mix), Blade, Livewire, and Inertia. PHP version compatibility is a non-issue — composer.json declares no PHP constraint, so it will install alongside any Laravel-supported runtime. It does not conflict with Bootstrap CSS versioning, Tailwind, or any component library. For a Laravel app already using Bootstrap 5 theming, this is the default-choice icon set with zero stylistic friction.

Migration path

  1. Inventory current icon usage: grep templates for the incumbent prefix and produce a slug → slug map with an explicit UNMAPPED bucket. Do not proceed until that bucket is triaged.
  2. Stand up the chosen rendering mode behind a single abstraction (<x-icon> / <x-bi>). Every call site goes through it — never raw <i class="bi …"> scattered in views.
  3. Migrate by traffic: navigation, empty states, and buttons first; then tables and forms; then long-tail (admin, emails).
  4. Run both icon sets in parallel behind the abstraction for one release cycle, then delete the legacy dependency and its CSS/font from the build.
  5. Add the CI guard (see Operational Impact) before removing the old set.

Compatibility

  • Composer: composer require twbs/bootstrap-icons — installs cleanly, but be aware nothing is registered. composer install --no-dev and --prefer-dist both ship the icons/ and font/ directories, so production builds retain the assets.
  • npm/Vite: npm i bootstrap-icons plus import 'bootstrap-icons/font/bootstrap-icons.css' works with Vite 4/5 and Laravel Mix. Vite resolves from node_modules; Composer's vendor/ path needs explicit resolve.alias or a copy step.
  • Deployment: read-only container filesystems are fine for file_get_contents reads. Serverless/Lambda with vendor zipped into a layer is also fine, but confirm the path is stable across your build stage.
  • Version pinning: use ~1.11.0 or an exact pin — not ^1. Minor releases rename slugs.

Sequencing

Phase Work Exit criteria
0. Spike (0.5 d) Render 3 icons via both Blade-component and font modes in staging Both render; vendor path confirmed in the real deploy image
1. Contract (1 d) Icon-name allowlist, single Blade component, a11y rules (aria-hidden decorative / aria-label interactive) Lint rule or code review checklist in place
2. Governance (0.5–1 d) CI test asserting every referenced slug exists in vendor/…/icons/; exact version pin Test fails on a simulated rename
3. Migrate (2–4 d) Traffic-ordered view migration via the abstraction Legacy icon CSS/font removed from bundle
4. Harden CSP review, sprite/CDN decision, bundle-size baseline Page weight delta measured and accepted

Operational Impact

Maintenance Steady-state code maintenance is effectively zero; the package is inert data. The real recurring cost is upgrade review, which is small but non-zero because icon renames ship in minor versions. Budget ~1 hour per version bump plus whatever the CI guard catches. Pin tightly, upgrade deliberately, and treat every bump as a potential silent-blank-icon event rather than a routine security patch.

Support Community-only: GitHub issues, the official docs site (searchable, per-icon HTML snippets in every usage mode), and Bootstrap's blog. MIT, no warranty, no SLA, no vendor to escalate to. The practical escalation path is "copy the SVG we need into our own repo and fork" — which is genuinely viable and worth stating as an accepted mitigation up front. Documentation quality is strong and consumer-facing, which materially reduces internal support load.

Scaling Static assets scale trivially — serve the sprite or font from CloudFront/Cloudflare with long-lived immutable caching keyed on the version. The one scaling caveat is the inline-SVG path: a naive implementation doing file_get_contents per icon per render will produce thousands of filesystem reads on icon-dense pages. Mitigate with a static per-request memo array, or better, a build step that compiles the used subset into a PHP array warmed by OPcache. Neither is hard, but both must be deliberate.

Failure modes

  • Silent blank icon on slug rename after a version bump — highest likelihood, low detectability. Caught only by the CI existence test or visual regression.
  • Tofu boxes / missing glyphs when the icon font fails to load or font-src CSP blocks it — loud visually, silent in logs.
  • 404s when public/ publish or Vite copy step is skipped in a deploy variant (classic prod-only regression).
  • Path traversal if a dynamic icon name reaches the filesystem unvalidated — allowlist, always.
  • Bundle bloat if the font approach is adopted and only a dozen icons are used; a sprite or inline subset avoids shipping 2,000 glyphs to render 12.
  • Vendor pruning in aggressive multi-stage Docker builds that strip vendor/ non-PHP paths — verify the build stage preserves icons/.

Ramp-up Low. A mid-level Laravel developer stands up the Blade component and migrates a representative page in under a day; full governance, CI guard, and a mid-size app migration is roughly 3–5 developer-days. The docs shortens onboarding further. The genuinely non-obvious parts — slug churn across minors, the vendor-path/public-asset mismatch, and a11y conventions for icon-only controls — should be captured in a short internal ADR and the component's docblock so they aren't rediscovered per developer.

Metrics to track Distinct icons in use (drives font-vs-sprite decision), page-weight delta attributable to icons, count of unmapped slugs during migration, and a post-upgrade assertion that zero referenced slugs went missing.

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.
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
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections