unplugin / unplugin-icons

🤹 Access thousands of icons as components on-demand universally.

Home Page:https://www.npmjs.com/package/unplugin-icons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to create a dynamic list of icons

mod7ex opened this issue · comments

How to print a list of icons just from an array for example [{ name: "edit" }, { name: "settings" }]

and i get

<i-mdi-edit />
<i-mdi-settings />

and in the browser it really renders the wanted icon

@modex98 you can try import.meta.glob or import.meta.globEager using raw option, but you'll need to use some directive to render the svg icon, check the raw option on readme

when i use import.meta.glob or import.meta.globEager
its warn that [plugin:vite:import-analysis] Invalid glob import syntax: pattern must start with "." or "/" (relative to project root) or alias path