Closed JustinVoitel closed 3 years ago
Unfortunately I couldn't get a working API using dynamic imports, so now you have to import icons like this:
<script>
import Icon, {X, ArrowUp} from "svelte-hero-icon"
</script>
<Icon src={X} solid />
<Icon src={ArrowUp} />
not the simplest API, but close IMO
The proposal is that instead of exporting every icon into its own svelte component (which can lead to import waterfalls), we export only one component and pass the information what icon source to import(dynamically):
The string we pass to the
src
attribute can be supported by generated types via SvelteComponentTypedThis could lead to a much smaller package with a better API.
Priorities