npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bootstrap-icons-vue

v1.11.3

Published

Bootstrap icons as Vue components.

Downloads

15,679

Readme

Free, high quality, open source icon library with over 1,500 icons. Include them anyway you like—SVGs, SVG sprite, or web fonts. Use them with or without Bootstrap in any project. -- Bootstrap Icons

This library provides Bootstrap icons as Vue 3.x components.

Built from Bootstrap Icons v1.11.3.

Installation

# Using yarn
yarn add bootstrap-icons-vue

# Or npm
npm install bootstrap-icons-vue

Alternatively, you can use them straight from a CDN without installation.

<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/[email protected]"></script>

Usage

1. Importing individual icons

Making them globally available for an app:

import { createApp } from "vue";
import {
  BIconBatteryFull,
  BIconArrow90degDown,
  BIconBookmark,
} from "bootstrap-icons-vue";

const app = createApp(/** App **/);
app.component("BIconBatteryFull", BIconBatteryFull);
app.component("BIconArrow90degDown", BIconArrow90degDown);
app.component("BIconBookmark", BIconBookmark);
app.mount("#app");

Or just for one component:

import {
  BIconBatteryFull,
  BIconArrow90degDown,
  BIconBookmark,
} from "bootstrap-icons-vue";

export default {
  components: {
    BIconBatteryFull,
    BIconArrow90degDown,
    BIconBatteryFull,
  },
  // ...
};

2. Importing all icons

import { createApp } from "vue";
import { BootstrapIconsPlugin } from "bootstrap-icons-vue";

const app = createApp(/** App **/);
app.use(BootstrapIconsPlugin);
app.mount("#app");

Note that this will register all icon components to the app instance, unused icons will not be tree-shakable.

3. Import all icons (for CDN build)

Vue 3 does not have a global application instance, so it is not possible to automatically expose the icons components. Instead you should install the provided plugin to your app instance.

const app = Vue.createApp(/** App **/);
app.use(BootstrapIconsVue);
app.mount("#app");

Naming convention

All icons are exported following the PascalCase naming convention, prefixed with BIcon. For example, the icon battery-full is exported as BIconBatteryFull, the icon arrow-90deg-down is exported as BIconArrow90degDown, etc. Vue allows you to refer to them in templates using either PascalCase or kebab-case.

<template>
  <BIconArrow90degDown />
  <!-- Or -->
  <b-icon-arrow-90deg-down />
</template>

Each icon is 1em in width and height. They can be styled by inheriting from their parent element, or receiving class or style attribute directly.

You can find the full list of available icons at https://icons.getbootstrap.com/.

Relation to BootstrapVue

BootstrapVue implements Bootstrap components (including Bootstrap Icons) and grid system as Vue 2 components. bootstrap-icons-vue is NOT intended to be used alongside BootstrapVue, as the latter is a superset of this project. Besides, they target different major Vue version.

This library is for those who wants to use Bootstrap Icons but do not wish to pull in a massive dependency (BootstrapVue).

Development

Install dependencies with yarn install then generate icon files with yarn build. To test the browser build, run yarn dev:cdn. With the vite app, first link the library by running yarn link in this directory, then yarn link bootstrap-icons-vue in ./dev-vite, finally run yarn dev:vite back in this directory.

The upgrade.sh script upgrades everything and update the docs with new version specifiers.