Closed JPaulMora closed 4 months ago
I have a sidebar menu in a svelte +layout.svelte with dynamic links:
+layout.svelte
<script lang="ts"> import { menuNavLinks } from '$lib/links'; import ArrowTD from 'virtual:icons/heroicons/arrow-trending-down-16-solid'; </script>
my links.ts looks like this:
// Navigation Sitemap export type List = Array<{ href: string; label: string; keywords: string; badge?: string }>; export const menuNavLinks: Record<string, Array<{ title: string; list: List }>> = { '/docs': [ { title: 'Docs', list: [ { href: '/docs/introduction', label: 'Introduction', keywords: 'svelte, sirens, license, release' }, { href: '/docs/get-started', label: 'Get Started', keywords: 'start, install, cli, tailwind, themes, stylesheets' }, { href: '/docs/quickstart', label: 'Quickstart', keywords: 'start, setup, tutorial, guide' } ] }, //etc..
I want to define the icon name as part of this structure and have it auto imported, if that makes sense. Thanks in advance.
Closing this issue, found a partial solution on https://github.com/unplugin/unplugin-icons/issues/5#issuecomment-1015972369. Based on that thread, dynamic icons are not possible.
I have a sidebar menu in a svelte
+layout.svelte
with dynamic links:my links.ts looks like this:
I want to define the icon name as part of this structure and have it auto imported, if that makes sense. Thanks in advance.