Comments (1)
Those packages are no longer maintained.
That specific package would be a CommonJS package, which should not be used in modern development process.
Offline icon component was created when solutions like Unplugin Icons did not exist. It is no longer needed in modern development process. Unplugin Icons does pretty much the same as you need, but without overhead because it does everything at build time. Offline icon component is far inferior solution compared to it.
For legacy users old packages will always be available, but no longer updated and new packages for new icon sets are no longer created.
Solutions?
If you do want to use that component with newer icons, it will require a bit of work. You'll need to create new files for icons, extract data from Iconify API and wrap that data in addCollection()
function that you can import from component.
For example, for Material Symbols Light, if you need icons chevron-right
and chevron-left
, get them from API like this:
https://api.iconify.design/material-symbols-light.json?icons=chevron-right,chevron-left
End point is icon set prefix + .json
, set icons
parameter to comma separated list of icons you need.
Copy icon data, wrap it in addCollection()
:
import { addCollection } from '@iconify/react';
addCollection({"prefix":"material-symbols-light","lastModified":1702636034,"aliases":{},"width":24,"height":24,"icons":{"lock":{"body":"<path fill=\"currentColor\" d=\"M6.615 21q-.666 0-1.14-.475Q5 20.051 5 19.385v-8.77q0-.666.475-1.14Q5.949 9 6.615 9H8V7q0-1.671 1.164-2.836T12 3q1.671 0 2.836 1.164T16 7v2h1.385q.666 0 1.14.475q.475.474.475 1.14v8.77q0 .666-.475 1.14q-.474.475-1.14.475zM12 16.5q.633 0 1.066-.434q.434-.433.434-1.066t-.434-1.066Q12.633 13.5 12 13.5t-1.066.434Q10.5 14.367 10.5 15t.434 1.066q.433.434 1.066.434M9 9h6V7q0-1.25-.875-2.125T12 4q-1.25 0-2.125.875T9 7z\"/>"},"lock-open":{"body":"<path fill=\"currentColor\" d=\"M6.615 9H15V7q0-1.25-.875-2.125T12 4q-1.25 0-2.125.875T9 7H8q0-1.671 1.164-2.836T12 3q1.671 0 2.836 1.164T16 7v2h1.385q.666 0 1.14.475q.475.474.475 1.14v8.77q0 .666-.475 1.14q-.474.475-1.14.475H6.615q-.666 0-1.14-.475Q5 20.051 5 19.385v-8.77q0-.666.475-1.14Q5.949 9 6.615 9M12 16.5q.633 0 1.066-.434q.434-.433.434-1.066t-.434-1.066Q12.633 13.5 12 13.5t-1.066.434Q10.5 14.367 10.5 15t.434 1.066q.433.434 1.066.434\"/>"}}})
then import that file in your code before components are rendered, so in something like app.ts or whatever main entry point is.
from iconify.
Related Issues (20)
- build iconify-icon in local failed HOT 6
- 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
- Typescript complains HOT 9
- api changes HOT 5
- width and height is not matched correctly when setting with a decimal HOT 1
- Icon collection request: Bitcoin Icons HOT 3
- Iconify on Svelte problem - Cannot find module HOT 1
- ✨ Align syntax for icons HOT 2
- Penpot integration HOT 2
- bug[React]: Icon Component does not render icon on first render when using `loadIcons` to preload HOT 5
- iconExists() not working on deployed site HOT 2
- [DEP0166] DeprecationWarning HOT 10
- [BUG] Deprecation Warning on Nuxt.js build due to package.json export HOT 2
- Workerd SSR issues HOT 1
- Hey I found an Issue !! 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.