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

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.65.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.65.0
File Size Uploaded Provenance Actions
fasthtml_lucide-1.65.0.tar.gz 175.6 kB Without provenance Details for fasthtml_lucide-1.65.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / fasthtml_lucide-1.65.0.tar.gz

Download URL fasthtml_lucide-1.65.0.tar.gz
Size 175.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5d7a9b31163559042306c153344b8a3889b74784014398e3fffe7ff5380a3ac6
BLAKE2b-256 checksum
How to use checksums
019f10c0448460b18adde48484dd9a6d4b3f83195c1e58f3bc5fdedfa006f590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.65.0-py3-none-any.whl

Download URL fasthtml_lucide-1.65.0-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
140207a15959a7b0ae817250969f5adc86a53472d0abebeadc18492cf9aa9db2
BLAKE2b-256 checksum
How to use checksums
256eb722c68efcdae436e34eaeef2dc65e6605987e805adce48a46cd2034463c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.65.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