Icon Packs
The fh_utils.icons
module provides a simple interface for integrating multiple popular icon libraries into your applications.
We make sure the icons to play nicely both with Tailwind and with standard css styles.
"NAME", "VARIANT", **fasttag_attributes)
IconPack("boat", "sharp", cls="size-10 fill-green-100 stroke-red-500 rotate-45") IonIcon(
The following icon libraries are supported, each with its respective license and associated Python class:
Icon Library | License | Class |
---|---|---|
Phosphoricons | MIT | PhIcon |
Heroicons | MIT | Heroicon |
Ionicons | MIT | IonIcon |
Lucide | Lucide License | LcIcon |
Font Awesome | CC BY 4.0 | FaIcon |
Bootstrap Icons | MIT | BsIcon |
Boxicons | MIT | BoxIcon |
The icons are fetched dynamically from GitHub when requested, and they are cached locally to avoid repeated downloads.
Usage
from fh_utils.icons import HeroIcon, IonIcon, LcIcon, PhIcon, FaIcon, BsIcon, BoxIcon
# Works nicely with tailwind
= dict(cls="size-10 fill-green-100 stroke-red-500 rotate-45")
kw "airplane-in-flight", **kw)
PhIcon("chart-bar-square", **kw)
Heroicon("boat", **kw)
IonIcon("message-square-heart", **kw)
LcIcon("bell", **kw)
FaIcon("bell", **kw)
BsIcon("smile", **kw)
BoxIcon(
# And without tailwind
= dict(width=40, stroke="red", fill="green")
kw "airplane-in-flight", "fill", **kw)
PhIcon("chart-bar-square", "20/solid", **kw)
Heroicon("boat", "sharp", **kw)
IonIcon("message-square-heart", **kw)
LcIcon("apple", "brands", **kw)
FaIcon("apple", **kw)
BsIcon("smile", **kw) BoxIcon(