Skip to main content

fasthtml-lucide

License Release Python versions PyPI version FastHTML Lucide uv Pytest Ruff

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.

Editor autocomplete suggesting Lucide icon names from the generated IconName type

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 weekly. 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 weekly 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.

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.78.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fasthtml-lucide 1.78.0
File Size Uploaded Provenance Actions
fasthtml_lucide-1.78.0.tar.gz 184.8 kB Without provenance Details for fasthtml_lucide-1.78.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fasthtml-lucide 1.78.0
File Interpreter ABI Platform Actions
fasthtml_lucide-1.78.0-py3-none-any.whl Python 3 none any Details for fasthtml_lucide-1.78.0-py3-none-any.whl

Total release size: 1.3 MB

Release files / fasthtml_lucide-1.78.0.tar.gz

Download URL fasthtml_lucide-1.78.0.tar.gz
Size 184.8 kB
Tags Source
SHA-256 checksum
How to use checksums
44800e5336c5c15461f5041768a694ddf02eadfdb0256fb1a63428d40e84e006
BLAKE2b-256 checksum
How to use checksums
9a7224c68035377c2fdc134251217b74ab2d528a32817382f2babe925f9b2d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.78.0-py3-none-any.whl

Download URL fasthtml_lucide-1.78.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3188e6f091f6c5b4125147f1d483f29b3ab3a8a721a8221ecb06222517c6ef90
BLAKE2b-256 checksum
How to use checksums
5074ba6bb6b3b112c7ef909240fdbde5ced3e7a062b16d27ee2529e76cc9729e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.78.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page