Some reasons:
- There is a need to reduce build/compile time. Official guide says there shouldn't have to be 1 svelte component per icon (see: https://svelte.dev/docs/kit/icons)
@lucide/svelteuses 1 svelte component per icon. There is also a performance hit if you use named exports instead of default exports, e.g:import { IconX } from '@lucide/svelte' import IconX from '@lucide/svelte/icons/x'- There is also a need for dynamic icons. For example, there is a custom
@starlight/iconspackage which provides anElementIconandMechanicIcon, depending on the actual element (fire, ice, lightning, etc) and actual mechanic (single target, aoe, etc) respectively. Currently, you need to create a somewhat verbose wrapper component to make this really work. - Technically,
@lucide/sveltedoes make this possible (see their guide), except this would also cause a massive performance hit - https://iconify.design/docs/usage/css/tailwind/tailwind4/ seems like a good alternative
- https://github.com/unplugin/unplugin-icons looks interesting as well
Could be worth adding https://github.com/ieedan/vite-plugin-transform-lucide-imports