Blade Bootstrap Icons

Drop every Bootstrap Icon into Laravel Blade views as self-closing SVG components

Library
Composer
vv2.2.0
73stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
39/100Needs Attention
Development Activity20
Maintenance20
Community44
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
64/100Good
Architecture58
Code Quality62
Innovation55
Learning Curve82

Blade Bootstrap Icons packages the full Bootstrap Icons set as ready-to-use Laravel Blade components, so any icon can be dropped into a view with a single self-closing tag like <x-bi-bell-fill/>. It builds on Blade Icons under the hood, giving each icon component support for custom classes and inline styles without any manual SVG wrangling.

For teams that would rather ship raw SVG assets instead of inline markup, the package includes an artisan vendor:publish command that copies every icon into the public/vendor directory for direct <img> usage. Because it wraps the well-known Bootstrap Icons library, designers and developers share a single, familiar icon vocabulary across Blade templates.

What You Get

  • Every Bootstrap Icon (2,000+) exposed as a bi- prefixed Blade component
  • Support for passing extra classes (<x-bi-bell-fill class="text-primary"/>) and inline styles
  • A service provider that registers the icon set with Blade Icons automatically on install
  • An artisan vendor:publish --tag=blade-bootstrap-icons command to export raw SVG files for <img>-based usage
  • Zero-config setup — just composer require and start using components

Common Use Cases

  • Adding consistent Bootstrap-style icons across a Laravel admin panel or dashboard
  • Icon buttons, nav items, and status indicators in Blade-based marketing or app UIs
  • Migrating a Bootstrap-themed app to Laravel Blade without redesigning its icon system
  • Publishing icons as static SVG assets for use outside of Blade templates

Under The Hood

Architecture — The entire package is a single service provider, src/BladeBootstrapIconsServiceProvider.php. Its register() method hooks into callAfterResolving(Factory::class, ...) from blade-ui-kit/blade-icons and calls $factory->add('bootstrap-icons', ['path' => __DIR__.'/../resources/svg', 'prefix' => 'bi']), which is what turns every file in resources/svg (2,078 SVGs) into an addressable <x-bi-{name}/> Blade component at render time. boot() registers a vendor:publish group tagged blade-bootstrap-icons that copies the same SVG directory to public_path('vendor/blade-bootstrap-icons') for non-Blade consumption.

Tech Stack — Requires PHP ^8.0 and illuminate/support ^9.0 through ^13.0, plus the single runtime dependency blade-ui-kit/blade-icons ^1.6 which does the actual SVG-to-component compilation and caching. Dev dependencies are orchestra/testbench and phpunit/phpunit, both spanning several major versions to test across the supported Laravel range. A package.json/webpack.mix.js pair exists in the repo but is unrelated to the package’s runtime behavior — it’s tooling used upstream to regenerate/process the vendored Bootstrap Icons SVGs.

Code Quality — The package’s own source is a single 20-line PHP class with no branching logic beyond a runningInConsole() guard, so there is very little surface area for defects. Test coverage is a single file, tests/CompilesIconsTest.php, using Orchestra Testbench to boot a minimal Laravel app and assert exact rendered SVG output for three cases: a bare icon, an icon with an added class, and an icon with an inline style — including a code comment flagging a known Blade-components double-class-attribute quirk rather than hiding it.

API Design — The public interface is a Blade component per icon, named to match the upstream Bootstrap Icons filenames (<x-bi-bell-fill/>), so there is no lookup table or helper function to learn — icon names map directly to https://icons.getbootstrap.com/. Styling is passed exactly like any other Blade component (class="..." or style="..."), so there’s zero new API surface beyond what Blade already offers, and setup is a single composer require with no manual service-provider registration needed thanks to Laravel package auto-discovery.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search