You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-36Lines changed: 41 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -15,41 +15,30 @@
15
15
16
16
> Bootstrap Icons are designed to work with Bootstrap components, from form controls to navigation. But, they'll work in just about any project, too. That's because Bootstrap Icons are SVGs, so they scale quickly and easily and can be styled with CSS. -- [Bootstrap Icons]
17
17
18
-
This package provides bootstrap icons as Vue components.
18
+
This library provides Bootstrap icons as Vue 3.x components.
19
19
20
-
Built from Bootstrap Icons v1.5.0.**Requires Vue 3.**
20
+
Built from Bootstrap Icons v1.5.0.
21
21
22
-
## Usage
23
-
24
-
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`.
25
-
26
-
```vue
27
-
<template>
28
-
<BIconArrow90degDown />
29
-
<!-- Or -->
30
-
<b-icon-arrow-90deg-down />
31
-
</template>
32
-
```
33
-
34
-
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.
35
-
36
-
You can find the full list of available icons at https://icons.getbootstrap.com/.
37
-
38
-
### With module bundlers
39
-
40
-
First install the package using your package manager of choice:
22
+
## Installation
41
23
42
24
```sh
25
+
# Using yarn
43
26
yarn add bootstrap-icons-vue
44
27
45
-
# or
46
-
28
+
# Or npm
47
29
npm install bootstrap-icons-vue
48
30
```
49
31
50
-
Then import the icons using one of the methods below:
32
+
Alternatively, you can use them straight from a CDN without installation.
Vue 3 does not have a global application instance, so it is not possible to install the icons components automatically. Instead the browser build exports a plugin `BootstrapIconsVue` to be installed:
86
+
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.
105
87
106
88
```js
107
89
constapp=Vue.createApp(/** App **/);
108
90
app.use(BootstrapIconsVue);
109
91
app.mount('#app');
110
92
```
111
93
94
+
### Naming convention
95
+
96
+
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`.
97
+
98
+
```html
99
+
<template>
100
+
<BIconArrow90degDown />
101
+
<!-- Or -->
102
+
<b-icon-arrow-90deg-down />
103
+
</template>
104
+
```
105
+
106
+
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.
107
+
108
+
You can find the full list of available icons at https://icons.getbootstrap.com/.
109
+
110
+
## Relation to [BootstrapVue]
111
+
112
+
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.
113
+
114
+
This library is for those who wants to use Bootstrap Icons but do not wish to pull in a massive dependency (BootstrapVue).
115
+
112
116
## Development
113
117
114
118
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.
115
119
116
120
The `upgrade.sh` script upgrades everything and update the docs with new version specifiers.
0 commit comments