Giter Site home page Giter Site logo

Comments (1)

cyberalien avatar cyberalien commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.