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)
- How about make tailwind plugin intelligent like @egoist/tailwindcss-icons HOT 9
- Prettier formatting error when using `@iconify/tailwind` and `@iconify/tools` HOT 8
- Usage of "alt" property throws error on SvelteKit + TypeScript HOT 2
- Adding TDesign Icons Collection HOT 7
- I added a new collection to Iconify but it doesn't see the collection? HOT 10
- Iconify Icons with MaterialUI IconButton HOT 9
- During packaging, assert json reports an error HOT 4
- Why not set min-width to avoid layout shift HOT 1
- How to configure getIconCss() function to be able to add icons when printing a page when pressing Ctr+P? HOT 4
- CORS issue with importing icons using @iconify/vue HOT 4
- Using static icons with Next.JS 13 HOT 7
- include uxwing.com icons HOT 2
- Sveltekit icon component change icon viewbox HOT 1
- Add option for @iconify/tailwind to disable height / width props HOT 6
- build iconify-icon in local failed HOT 7
- No exports condition for Svelte (Deprecation Warning) HOT 3
- ReferenceError: exports is not defined HOT 3
- search page can set bigger or loading more HOT 1
- Tailwindcss - Svelte - CMS HOT 3
- svelte OfflineIcon broken with 3.1.6 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.