Lucide icons for FastHTML
Project description
lucide-fasthtml
Any use of the code retrieved from lucide.dev is subject to the terms of the Lucide license, found here.
A small package for FastHTML that allows you to use Lucide icons efficiently with fasthtml projects, avoiding cdn's and downloading entire static bundles. Features include:
- Full tree-shaking support
- Client-side
script
retrieval on cache-miss - Streamlined attribute handling for full customization (mimics lucide-react)
- Immediate icon retrieval on cache-hit, no additional network requests
Table of Contents
Installation
pip install lucide-fasthtml
Usage
from lucide_fasthtml import Lucide
Lucide("sun") # or Lucide(icon="sun")
[!RESULT]
Customization
Supports all standard svg attributes. Defaults are set to the standard defaults found at lucide.dev. For ease of use, streamlined attributes used by lucide-react
are also supported in a FastHTML-compatible format.
lucide-react | lucide-fasthtml | notes |
---|---|---|
color="red" |
color="red" |
Can be used instead of stroke . Sets the color of the icon stroke. |
strokeWidth="2" |
stroke_width="2" |
Sets the stroke width of the icon. |
absoluteStrokeWidth=True |
absolute_sw=True |
Calculates the stroke width based on the icon's size, to standardize the stroke width across different icon sizes. |
size=16 |
size=16 |
Can be used instead of width and height properties. Sets the size (width and height) of the icon to the specified value. |
Lucide("sun", color="red", stroke_width="1.5", absolute_sw=True, size=16)
[!RESULT]
License
lucide-fasthtml
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lucide_fasthtml-0.0.2.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for lucide_fasthtml-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd7b1ac02e2aa7a5f43b56216a8d828ca9213eb6aa517dd25cc78f0fee37ee97 |
|
MD5 | 00420c57b84966d6561cfd4cb93ecfd2 |
|
BLAKE2b-256 | a885146f52a226cd0b3faab8f37b384eca4174866fc8ac89f4c13ea34232bdbf |