Comments (3)
Vue component doesn't have addCollection() function. Only SVG framework and React component with API have it.
I'll add it to Vue and other components.
from iconify.
Added.
Vue 2 usage (to install component use npm install @iconify/vue@^1
):
<template>
<iconify-icon icon="jam:home" />
</template>
<script>
import IconifyIcon from '@iconify/vue';
// Import requires bundler that can import JSON files
import jamIcons from '@iconify/json/json/jam.json';
// Function automatically adds prefix from icon set, which in this case is 'jam', followed by ':', so
// icon names added by function should be called with prefix, such as 'jam:home'
IconifyIcon.addCollection(jamIcons);
export default {
components: {
IconifyIcon,
},
};
</script>
Vue 3 usage (to install component use npm install @iconify/vue@beta
):
<template>
<Icon icon="jam:home" height="24" />
</template>
<script>
import { Icon, addCollection } from '@iconify/vue';
// Import requires bundler that can import JSON files
import jamIcons from '@iconify/json/json/jam.json';
// Function automatically adds prefix from icon set, which in this case is 'jam', followed by ':', so
// icon names added by function should be called with prefix, such as 'jam:home'
addCollection(jamIcons);
// Example without prefix, all icons will have names as is, such as 'home'
// addCollection(jamIcons, false);
export default {
components: {
Icon,
},
};
</script>
Also React usage: (install npm install @iconify/react@beta
):
import React from 'react';
import { Icon, addCollection } from '@iconify/react';
// Import requires bundler that can import JSON files
import jamIcons from '@iconify/json/json/jam.json';
// Function automatically adds prefix from icon set, which in this case is 'jam', followed by ':', so
// icon names added by function should be called with prefix, such as 'jam:home'
addCollection(jamIcons);
// Example without prefix, all icons will have names as is, such as 'home'
// addCollection(jamIcons, false);
export function MyComponent() {
return (
<div>
<Icon icon="jam:home" />
</div>
);
}
from iconify.
Guess you can simply use
Iconify.addCollection(bx)
from iconify.
Related Issues (20)
- Iconset request: Fluentui Emoji HOT 1
- ESM import issues HOT 6
- please add information about attribute `observer` and `noobserver` in the offcial site document HOT 1
- How do you guarantee icons don't change HOT 3
- Iconify - Definitely the easiest! Why not the fastest? HOT 6
- Feature Request: A SDK to pick icons
- Show API link for icons HOT 2
- Tailwind plugin: allow non-square icons HOT 1
- [@iconify-icon/react] Not show in next-app-dir HOT 1
- When I want to achieve offline on-demand loading need to use the icon, when packaged online, there will be some icons appear, some icons do not appear HOT 3
- Add "Atlas Icons" set HOT 6
- Consider supporting root attributes for icons in JSON format HOT 1
- Nuxt Error while using @iconify-json/fluent-emoji HOT 2
- Add "Iconsax" set HOT 1
- error import cheerio HOT 3
- once the animation done it doesnt restart HOT 5
- Imports with "assert" keyword are not supported anymore HOT 5
- Solid start error HOT 1
- [BUG?] @iconify/utils `getIconCss` does not respect transformations HOT 1
- Vite build warning with `@iconify/tailwind` package HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iconify.