fasthtml-lucide
Lucide SVG icons for FastHTML. Icons are bundled in the Python package: no Node.js, JavaScript, CDN or static-file setup is needed in your application.
Installation
Install with uv:
uv add fasthtml-lucide
Or with pip:
pip install fasthtml-lucide
Usage
from fasthtml.common import Button
from fasthtml_lucide import Icon
Button(Icon("sun", cls="size-5 text-yellow-500"), "Light mode")
Icon(name, *, cls="", size=24) accepts kebab-case Lucide names and returns an inline SVG. Colors inherit through currentColor. Original SVG classes are kept. Invalid or unknown names raise ValueError.
Icon("settings", size=20)
Icon("heart", cls="text-red-500")
Icons are decorative (aria-hidden="true"), so icon-only buttons should have an accessible label on the button itself.
Typed icon names
The package generates an IconName type containing every available icon name, providing editor autocomplete and type checking for misspelled names.
You can also use the type in your own components:
from fasthtml.common import Button
from fasthtml_lucide import Icon, IconName
def IconButton(icon: IconName, label: str):
return Button(Icon(icon), label)
Automatic updates
The library is automatically updated to the latest stable lucide-static release on npm, with checks running daily. The PyPI version matches the npm version; Python-only fixes may add a .postN suffix.
For Tailwind CSS integration with persistent watch mode, see fasthtml-tailwindcss.
Development
Build
Requires Python 3.11+, uv and Node.js/npm when building from Git:
uv build
The build hook downloads the matching lucide-static release and bundles its SVGs and license in both the wheel and sdist. Building from the sdist does not require Node.js/npm.
To run the tests against the built package:
uv venv
uv pip install --group test dist/*.whl
uv run --no-project python -m pytest tests
uv run --no-project python scripts/check_dist.py
Automated releases
The Release workflow checks npm daily and can also be run manually. It updates the package version, builds and tests the release, creates a Git tag and publishes to PyPI using Trusted Publishing.
Manual releases
For a Python-only fix, increment the post-release version (for example, 1.61.0 → 1.61.0.post1 → 1.61.0.post2):
uv version --bump post --frozen
Commit your fix and pyproject.toml, push to the default branch, then select Actions → Release → Run workflow on GitHub. The workflow creates the tag and publishes to PyPI. The Lucide version stays the same unless a newer npm release is available.
Links
License
The Python wrapper is MIT licensed. Bundled Lucide icons retain the upstream ISC license and the MIT notices for icons derived from Feather, included in fasthtml_lucide/LUCIDE-LICENSE.
Metadata
Release files for fasthtml-lucide 1.67.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fasthtml_lucide-1.67.0.tar.gz | 177.0 kB | Without provenance | Details for fasthtml_lucide-1.67.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fasthtml_lucide-1.67.0-py3-none-any.whl | Python 3 | none | any | Details for fasthtml_lucide-1.67.0-py3-none-any.whl |
Total release size: 1.3 MB
Release files / fasthtml_lucide-1.67.0.tar.gz
| Download URL | fasthtml_lucide-1.67.0.tar.gz |
|---|---|
| Size | 177.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6861581515ef4c35d63d75561247c2e677c7c93699cfab3e63cfd17149534c8c
|
|
BLAKE2b-256 checksum How to use checksums |
fac035dc7ce400a1f8133fe7623b1fdb2a8f1e5906afa26b0a4511a2384f1455
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fasthtml_lucide-1.67.0-py3-none-any.whl
| Download URL | fasthtml_lucide-1.67.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87fe46a1be52e527eb514ebc4432ea1e9b9c8d7764366f78b1d0f74aa53c747c
|
|
BLAKE2b-256 checksum How to use checksums |
52f19e7ebd48756fc1bd831dc7231644ae546ac4a105ebb71f6f6855a59c3287
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fasthtml-lucide 1.67.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.