tkinter support for feather icons
Current version: 1.0.1
- Fixes for and improvements to the example showcase
- Minor performace improvements
tkfeather can be installed with pip
pip install tkfeatherImport tkfeather like so
from tkfeather import FeatherOnce you've imported the Feather class, you can instantiate it as many times as you need
Feather(name: str, size: int [optional])name: str- The name of the Feather iconsize: int [optional]- The size of the icon image in pixels, square (default: 24)
Warning
Sizes smaller than 24px are allowed but aren't recommended as the icon will become blurred
The minimum allowed size is 1, and the maximum allowed size is 1024
Feather.icon- anImageTk.PhotoImageobject for the given Feather icon
Feather.icons_available()returns a list with the names of all available Feather Icons
Tip
tkfeather v1.0.1 supports all of the icons available in Feather Icons v4.29.0
- Passing a
sizevalue outside the range of 1 to 1024 will raise aValueError - Trying to use an icon that doesn't exist will raise a
FileNotFoundError
You must maintain a reference to the Feather instance in a variable in order to keep the image from being garbage-collected:
# this works
feather = Feather('home')
label = tk.Label(parent, image=feather.icon)
label.pack()If you don't maintain a reference to the image, it won't appear!
# this doesn't work - the label will have no image
label = tk.Label(parent, image=Feather('home').icon)
label.pack()To see an example application showcasing all of the available icons, you can run the tkfeather.showcase like so:
python3 -m tkfeather.showcase- PNG Icons
- Pillow >= 9.2.0
Based on Feather Icons originally created by Cole Bemis, used under the MIT License
