2.0.3 • Published 4 months ago

@babeard/svelte-heroicons v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

svelte-heroicons

Please note: This is a temprorary fork of rgossiaux/svelte-heroicons until v2 support is merged.

Yet another Svelte wrapper for Heroicons.

This library differs from others in a couple main ways:

  • The icon components forward common event listeners to the underlying SVG, so you may use on:click and so on;
  • The API is closer to the official React wrappers, making it easier to use when converting Tailwind UI components to Svelte in conjunction with svelte-headlessui;
  • It's based on Heroicons 2.1.1

Installation

npm install -D @babeard/svelte-heroicons@next

Usage

Heroicons contains three types of icons: outline, solid, mini, and micro. They can be imported from @babeard/svelte-heroicons/outline, @babeard/svelte-heroicons/solid, @babeard/svelte-heroicons/mini, and @babeard/svelte-heroicons/micro respectively.

All icon names are CamelCased and end with the word Icon; for example, the academic-cap icon on heroicons.com is imported as AcademicCapIcon.

<script>
  import { MegaphoneIcon } from "@babeard/svelte-heroicons/solid";
  import { CheckIcon } from "@babeard/svelte-heroicons/outline";
  import { ChatBubbleLeftIcon } from "@babeard/svelte-heroicons/mini"
</script>

<CheckIcon />
<MegaphoneIcon class="my-class" aria-hidden="true" />
<ChatBubbleLeftIcon />

Upgrading to v2

With the new release of hericons, there are some breaking changes to be aware of.

See the heroicons v2 release notes for additional information.

New Icon Styles

There are now 3 styles of icons to choose from instead of 2

  • Outline — line icons with a 1.5px stroke, drawn in a 24px view box.
  • Solid — solid icons with filled shapes, drawn in a 24px view box.
  • Mini — solid icons with filled shapes, drawn in a 20px view box.
  • Micro — solid icons with filled shapes, drawn in a 16px view box.

Note: The old Solid with the view box size of 20px was essentially renamed to Mini in v2.

Icons Renamed

Many icons were renamed to more literal names. For exmaple, MailIcon has been renamed to EnvelopeIcon, and SearchIcon has been renamed to MagnifyingGlassIcon.

Old NameNew Name
AdjustmentsIconAdjustmentsVerticalIcon
AnnotationIconChatBubbleBottomCenterTextIcon
ArchiveIconArchiveBoxIcon
ArrowCircleDownIconArrowDownCircleIcon
ArrowCircleLeftIconArrowLeftCircleIcon
ArrowCircleRightIconArrowRightCircleIcon
ArrowCircleUpIconArrowUpCircleIcon
ArrowNarrowDownIconArrowLongDownIcon
ArrowNarrowLeftIconArrowLongLeftIcon
ArrowNarrowRightIconArrowLongRightIcon
ArrowNarrowUpIconArrowLongUpIcon
ArrowSmLeftIconArrowSmallLeftIcon
ArrowSmRightIconArrowSmallRightIcon
ArrowSmUpIconArrowSmallUpIcon
ArrowSmDownIconArrowSmallDownIcon
ArrowsExpandIconArrowsPointingOutIcon
BadgeCheckIconCheckBadgeIcon
BanIconNoSymbolIcon
BookmarkAltIconBookmarkSquareIcon
CashIconBanknotesIcon
ChartSquareBarIconChartBarSquareIcon
ChatAlt2IconChatBubbleLeftRightIcon
ChatAltIconChatBubbleLeftEllipsisIcon
ChatIconChatBubbleOvalLeftEllipsisIcon
ChipIconCpuChipIcon
ClipboardCheckIconClipboardDocumentCheckIcon
ClipboardCopyIconClipboardDocumentIcon
ClipboardListIconClipboardDocumentListIcon
CloudDownloadIconCloudArrowDownIcon
CloudUploadIconCloudArrowUpIcon
CodeIconCodeBracketIcon
CollectionIconRectangleStackIcon
ColorSwatchIconSwatchIcon
CursorClickIconCursorArrowRaysIcon
DatabaseIconCircleStackIcon
DesktopComputerIconComputerDesktopIcon
DeviceMobileIconDevicePhoneMobileIcon
DocumentAddIconDocumentPlusIcon
DocumentDownloadIconDocumentArrowDownIcon
DocumentRemoveIconDocumentMinusIcon
DocumentReportIconDocumentChartBarIcon
DocumentSearchIconDocumentMagnifyingGlassIcon
DotsCircleHorizontalIconEllipsisHorizontalCircleIcon
DotsHorizontalIconEllipsisHorizontalIcon
DotsVerticalIconEllipsisVerticalIcon
DownloadIconArrowDownTrayIcon
DuplicateIconSquare2StackIcon
EmojiHappyIconFaceSmileIcon
EmojiSadIconFaceFrownIcon
ExternalLinkIconArrowTopRightOnSquareIcon
ExclamationIconExclamationTriangleIcon
EyeOffIconEyeSlashIcon
FastForwardIconForwardIcon
FilterIconFunnelIcon
FolderAddIconFolderPlusIcon
FolderDownloadIconFolderArrowDownIcon
FolderRemoveIconFolderMinusIcon
GlobeIconGlobeAmericasIcon
HandIconHandRaisedIcon
InboxInIconInboxArrowDownIcon
LibraryIconBuildingLibraryIcon
LightningBoltIconBoltIcon
LocationMarkerIconMapPinIcon
LoginIconArrowLeftOnRectangleIcon
LogoutIconArrowRightOnRectangleIcon
MailOpenIconEnvelopeOpenIcon
MailIconEnvelopeIcon
MenuAlt1IconBars3CenterLeftIcon
MenuAlt2IconBars3BottomLeftIcon
MenuAlt3IconBars3BottomRightIcon
MenuAlt4IconBars2Icon
MenuIconBars3Icon
MinusSmIconMinusSmallIcon
MusicNoteIconMusicalNoteIcon
OfficeBuildingIconBuildingOfficeIcon
PencilAltIconPencilSquareIcon
PhoneIncomingIconPhoneArrowDownLeftIcon
PhoneMissedCallIconPhoneXMarkIcon
PhoneOutgoingIconPhoneArrowUpRightIcon
PhotographIconPhotoIcon
PlusSmIconPlusSmallIcon
PuzzleIconPuzzlePieceIcon
QrcodeIconQrCodeIcon
ReceiptTaxIconReceiptPercentIcon
RefreshIconArrowPathIcon
ReplyIconArrowUturnLeftIcon
RewindIconBackwardIcon
SaveAsIconArrowDownOnSquareStackIcon
SaveIconArrowDownOnSquareIcon
SearchCircleIconMagnifyingGlassCircleIcon
SearchIconMagnifyingGlassIcon
SelectorIconChevronUpDownIcon
SortAscendingIconBarsArrowUpIcon
SortDescendingIconBarsArrowDownIcon
SpeakerphoneIconMegaphoneIcon
StatusOfflineIconSignalSlashIcon
StatusOnlineIconSignalIcon
SupportIconLifebuoyIcon
SwitchHorizontalIconArrowsRightLeftIcon
SwitchVerticalIconArrowsUpDownIcon
TableIconTableCellsIcon
TemplateIconRectangleGroupIcon
TerminalIconCommandLineIcon
ThumbDownIconHandThumbDownIcon
ThumbUpIconHandThumbUpIcon
TranslateIconLanguageIcon
TrendingDownIconArrowTrendingDownIcon
TrendingUpIconArrowTrendingUpIcon
UploadIconArrowUpTrayIcon
UserAddIconUserPlusIcon
UserRemoveIconUserMinusIcon
ViewBoardsIconViewColumnsIcon
ViewGridAddIconSquaresPlusIcon
ViewGridIconSquares2x2Icon
ViewListIconBars4Icon
VolumeOffIconSpeakerXMarkIcon
VolumeUpIconSpeakerWaveIcon
XIconXMarkIcon
ZoomInIconMagnifyingGlassPlusIcon
ZoomOutIconMagnifyingGlassMinusIcon

Documentation

See heroicons.com for the full list of icons.

License

As with the main Heroicons library, this library is MIT licensed.

Credit

All credit goes to Tailwind Labs for designing the icons and to the original ancestor to this fork rgossiaux/svelte-heroicons.

2.0.3

4 months ago

2.0.2

4 months ago

2.0.1

4 months ago

2.0.0-rc.0

2 years ago