Metadata-Version: 2.3
Name: lucide-fasthtml
Version: 0.0.7
Summary: Lucide icons for FastHTML
Project-URL: Documentation, https://github.com/curtis-allan/lucide-fasthtml#readme
Project-URL: Issues, https://github.com/curtis-allan/lucide-fasthtml/issues
Project-URL: Source, https://github.com/curtis-allan/lucide-fasthtml
Author-email: Curtis Allan <curtisjallan98@gmail.com>
License-Expression: MIT
License-File: LICENSE.txt
Keywords: fasthtml,icons,lucide
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: python-fasthtml>=0.5.2
Requires-Dist: requests>=2.32.2
Description-Content-Type: text/markdown

# lucide-fasthtml

*Any use of the code retrieved from lucide.dev is subject to the terms of the Lucide license, found [here](https://lucide.dev/license).*

[![PyPI - Version](https://img.shields.io/pypi/v/lucide-fasthtml.svg)](https://pypi.org/project/lucide-fasthtml)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lucide-fasthtml.svg)](https://pypi.org/project/lucide-fasthtml)

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 - only saves the icons you use. 
- Client-side `script` retrieval on cache-miss
- Streamlined attribute handling for full customization (mimics [lucide-react](https://lucide.dev/guide/packages/lucide-react))
- On-demand download/save of icons. Downloaded on first call and stored in a dict within the package.
- Immediate icon retrieval on cache-hit (SSR)
-----

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Customization](#customization)
- [License](#license)

## Installation

```console
pip install lucide-fasthtml
```

## Usage

```python
from lucide_fasthtml import Lucide

Lucide("sun") # or Lucide(icon="sun")
```
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="m2 12h2"/><path d="m20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>

## Customization

Supports all standard svg attributes. Defaults are set to the standard defaults found at [lucide.dev](https://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. |

```python
Lucide("sun", color="red", stroke_width="1.5", absolute_sw=True, size=16)
```
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="red" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="m2 12h2"/><path d="m20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>

All icon data can be found in the generated `icons.py` file within the package. You can manually add/remove icons as needed, or delete the entire file to re-download all used icons when started next.

## License

`lucide-fasthtml` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
