svelte-hero-icons
TypeScript icon, indicating that this package has built-in type declarations

5.2.0 • Public • Published

Svelte Heroicons

If you want to use more Icons Packs and components for multiple Frameworks (React, Vue, Lit and more), check out @steeze-ui/icons which is meant as a successor to svelte-hero-icons:

What is @steeze-ui/Icons ?

  • Icon Components for various frameworks (svelte, lit, solid and react)
  • Icon Packs (e.g heroicons, radix-icons, feathericons and more)
  • A template to create your own publishable Icon Pack
  • Now lives under an org that will focus on more ui tools for svelte

Description

  • complete heroicons set optimized for svelte
  • programatically change solid or outline version based on the solid attribute (solid, mini, micro)
  • fully typed for a great IDE experience
  • works out of the box with SvelteKit
  • SSR compatible (no JS is needed for the client to display the icon)

Installation

  • install as devDependency

Example for npm

npm i -D svelte-hero-icons

Configuration

  • svelte-hero-icons should work with SvelteKit without any configuration
  • If you have any problems, this could help adding to your vite.config.js:
ssr: {
   noExternal: ["svelte-hero-icons"],
 }

Usage

  • Default is Outline version of icon
  • Use solid attribute for Solid Icons
<script>
  // Only import what you need!
  import { Icon, ArrowUp, Filter } from "svelte-hero-icons";
</script>
<!-- default it's using the outline version of this icon -->
<Icon src="{Filter}" />

<!-- use solid attribute to display the solid version of this icon -->
<Icon src="{Filter}" solid />

<!-- use mini attribute to display the mini version of this icon -->
<Icon src="{Filter}" mini />

<!-- use micro attribute to display the micro version of this icon -->
<Icon src="{Filter}" micro />

<!-- in this (rather unusual) case solid will have the precedence -->
<Icon src="{Filter}" solid mini />

<!-- use size attribute to set icon size (32 -> 32px | 2rem | 100% == default ) -->
<Icon src="{ArrowUp}" size="32" />

<!-- use Windi CSS or tailwindcss classes directly -->
<Icon src="{Filter}" class="h-6 text-red-500 w-6" />

Use with types

<script>
  import { Icon, Filter, type IconSource } from "svelte-hero-icons";
  export let icon:IconSource = Filter
</script>

<Icon src="{icon}" solid />

Author

This package is based on heroicons

See all available icons here: https://github.com/refactoringui/heroicons

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.1.0-next.00next
4.0.0-beta.00beta
5.2.01,939latest

Version History

VersionDownloads (Last 7 Days)Published
5.2.01,939
5.1.0454
5.1.0-next.00
5.0.0601
5.0.0-next.00
4.1.3312
4.1.3-next.10
4.1.20
4.1.11
4.1.03
4.1.0-next.00
4.0.31
4.0.20
4.0.10
4.0.00
4.0.0-beta.00
3.2.0-beta.00
3.1.22
3.1.10
3.1.00
3.1.0-beta.30
3.1.0-beta.20
3.1.0-beta.10
3.0.00
3.0.0-beta.30
3.0.0-beta.20
3.0.0-beta.10
2.5.00
2.4.00
2.3.00
2.2.01
2.2.0-beta.00
2.1.20
2.1.10
2.1.1-beta.20
2.1.1-beta.10
2.1.00
2.0.00
2.0.0-beta.150
2.0.0-beta.140
2.0.0-beta.130
2.0.0-beta.120
2.0.0-beta.110
2.0.0-beta.100
2.0.0-beta.90
2.0.0-beta.80
2.0.0-beta.70
2.0.0-beta.60
2.0.0-beta.50
2.0.0-beta.40
2.0.0-beta.30
2.0.0-beta.20
2.0.0-beta.10
2.0.0-beta.00
1.6.0-next.40
1.6.0-next.30
1.6.0-next.20
1.6.0-next.10
1.5.010
1.4.00
1.3.00
1.2.00
1.1.00
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.1.00

Package Sidebar

Install

npm i svelte-hero-icons

Weekly Downloads

2,546

Version

5.2.0

License

MIT

Unpacked Size

7.65 kB

Total Files

7

Last publish

Collaborators

  • justinvoitel