Closed mattjennings closed 3 years ago
These are published under heroicons-svelte
.
Note: if you want to use this with SvelteKit, make sure you install it as a regular dependency and not a devDependency.
import { HomeIcon } from 'heroicons-svelte/solid'
import { HomeIcon } from 'heroicons-svelte/outline'
// alternatively
import HomeIcon from 'heroicons-svelte/solid/HomeIcon.svelte'
import HomeIcon from 'heroicons-svelte/outline/HomeIcon.svelte'
@adamwathan and @sschoger , can this be merged in for svelte users please. This will help with working with tailwindUI examples written for Vue, when creating svelte components
I've been looking at adding typescript types so that the components use SVG attributes as their props. However, Svelte doesn't ship types for HTML elements, instead they're in their svelte2tsx
package (which powers their language server). So in order to use those we'd have to add that as a dependency to @heroicons/svelte
.
If we're OK with doing that for the sake of types, I can push my changes to this PR. I have these changes published in @mattjennings/heroicons-svelte@0.0.6
in the meantime.
Wow, thanks for doing this @mattjennings!!
If anybody needs it to install now:
add to package.json
:
"dependencies":
...
"@heroicons/svelte": "git+https://github.com/mattjennings/heroicons.git#@mattjennings/heroicons-svelte",
...
and run:
npm install @heroicons/svelte`
How are we going with this one?
Maintaining additional wrapper libraries isn't a priority right now I'm afraid, better for someone who wants this to exist to publish and maintain it themselves 👍🏻
Thanks either way I do appreciate the contribution ❤️ we just don't have the resources to take on additional OSS maintenance.
No worries, I understand the decision completely.
I've published this under heroicons-svelte now and will keep it maintained as best I can.
Adds Svelte components, which can be built with
npm run build-svelte
.They are exported as .svelte components rather than compiled .js files. This is the recommended way to provide svelte components in a library, and are found via the
svelte
entry field in package.json.If there's a strong argument for compiling them as .js files, I did do this initially using svelte's compiler API but I could not get them to work in SSR environments. I am sure there's a solution to this, but at that point I felt .svelte components may be best anyway.