@iconify-prerendered/vue-cbi 0.23.1705842104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/index.d.ts +1075 -0
- package/index.js +1076 -0
- package/package.json +1 -0
package/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Custom Brand Icons components for Vue
|
2
|
+
|
3
|
+
Designed for ease of use and high performance. Each icon in set is standalone
|
4
|
+
component.
|
5
|
+
|
6
|
+
## Features
|
7
|
+
|
8
|
+
- **Easy to use**
|
9
|
+
- No plugins required! Compatible with any build tools.
|
10
|
+
- Designed for best compatibility with IDE auto-completion
|
11
|
+
([Demo](https://twitter.com/alex_kozack/status/1560608558127140865)).
|
12
|
+
- Zero dependencies.
|
13
|
+
- SSR / SSG friendly.
|
14
|
+
- TypeScript support.
|
15
|
+
- **High performance**
|
16
|
+
- Does not require any external resources like fonts, css, images.
|
17
|
+
- The icon code is embedded in your bundle.
|
18
|
+
- Supports tree shaking, so only those icons that you have used will be
|
19
|
+
included in the bundle.
|
20
|
+
- Works offline.
|
21
|
+
- Powered by [iconify](https://iconify.design/).
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
```vue
|
26
|
+
<script setup>
|
27
|
+
// Import components as usual
|
28
|
+
import {
|
29
|
+
IconMitsubishi,
|
30
|
+
IconEspn,
|
31
|
+
IconRoomscomputer,
|
32
|
+
} from '@iconify-prerendered/vue-cbi'
|
33
|
+
</script>
|
34
|
+
|
35
|
+
<template>
|
36
|
+
<!-- And just use it in template -->
|
37
|
+
<IconMitsubishi/>
|
38
|
+
<IconEspn/>
|
39
|
+
<IconRoomscomputer/>
|
40
|
+
</template>
|
41
|
+
```
|
42
|
+
|
43
|
+
Only these three icons will be included in your bundle. All other icons may be
|
44
|
+
tree-shaken by your bundler.
|
45
|
+
|
46
|
+
That's all you need. No plugins, extra configs, IDE extensions or something
|
47
|
+
else.
|
48
|
+
|
49
|
+
## Customizing icon default attributes
|
50
|
+
|
51
|
+
By default, all icons have only two attributes: `role="img"` and
|
52
|
+
`aria-hidden="true"`. While you are free to redefine these attributes or add new
|
53
|
+
ones for each individual icon, you might want to apply certain attributes, such
|
54
|
+
as `class` or `style`, to all icons within a set.
|
55
|
+
|
56
|
+
To achieve this, you can re-export icons through a `new Proxy` and include
|
57
|
+
default attributes
|
58
|
+
|
59
|
+
```javascript
|
60
|
+
import * as defaultIcons from '@iconify-prerendered/vue-cbi';
|
61
|
+
|
62
|
+
// accessing to icon through this Proxy will add additional attributes
|
63
|
+
export const themedIcons = new Proxy({}, {
|
64
|
+
get(_, iconKey) {
|
65
|
+
return () =>
|
66
|
+
defaultIcons[iconKey]({
|
67
|
+
class: 'pre-defined-class',
|
68
|
+
// ... any other attributes
|
69
|
+
});
|
70
|
+
},
|
71
|
+
});
|
72
|
+
```
|
73
|
+
|
74
|
+
See [full docs](https://github.com/cawa-93/iconify-prerendered/#readme) or
|
75
|
+
[other available icons sets](https://github.com/cawa-93/iconify-prerendered/#available-icons-sets).
|