bootstrap-icons-vue is a lightweight library that provides Bootstrap Icons as native Vue 3 components. Currently at version 1.11.3, its release cadence is tightly coupled with the upstream `bootstrap-icons` library, ensuring users always have access to the latest icon sets shortly after their release. The library differentiates itself by offering direct Vue 3 component integration, avoiding the need to pull in the entire BootstrapVue framework, which targets Vue 2 and includes many more components than just icons. It supports both individual icon imports for optimal tree-shaking and a plugin for global registration, catering to various project needs. With over 1900 icons, it offers a comprehensive icon solution for modern Vue 3 applications.
npm install bootstrap-icons-vueVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import individual Bootstrap Icon components and register them globally in a Vue 3 application. This approach allows for optimal tree-shaking, ensuring only used icons are included in the final bundle.
For optimal bundle size, import and register only the specific icon components you intend to use. This allows bundlers to effectively tree-shake unused icons.
If you are on Vue 2.x, consider BootstrapVue. If on Vue 3.x and needing Bootstrap components, look into BootstrapVueNext or other dedicated Vue 3 component libraries. `bootstrap-icons-vue` is purely for the icons themselves.
Refer to the Bootstrap Icons website for original icon names, then convert them to `PascalCase` and prepend `BIcon`. For example, `arrow-90deg-down` maps to `BIconArrow90degDown`. Vue templates also support `kebab-case` if the component is registered with `PascalCase`.
Either import individual icon components (e.g., `import { BIconBatteryFull } from 'bootstrap-icons-vue';`) and register them in your component's `components` option or globally via `app.component()`, or use `app.use(BootstrapIconsPlugin)` to register all icons globally.For optimal bundle size, avoid the `BootstrapIconsPlugin`. Instead, import and register only the specific icon components you need in each component or globally. `bootstrap-icons-vue` versions since v0.4.1 include hints for bundlers like Terser to enable tree-shaking for individual icon imports.
If using a CDN, ensure the `<script src="https://unpkg.com/bootstrap-icons-vue@latest"></script>` tag is present and loaded before your Vue application script. If using a module bundler, import named icon components or the `BootstrapIconsPlugin` (e.g., `import { BootstrapIconsPlugin } from 'bootstrap-icons-vue';`) instead.