Metadata-Version: 2.4
Name: django-lucide
Version: 1.3.1
Summary: Use lucide in your Django and Jinja templates.
Author-email: Marcin Wilczyński <wilczynskiwm@gmail.com>
License: MIT
Project-URL: Changelog, https://github.com/wilczynskiwm/lucide/blob/main/CHANGELOG.md
Project-URL: Repository, https://github.com/wilczynskiwm/lucide
Keywords: Django
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
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 :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: django
Requires-Dist: django>=2.2; extra == "django"
Provides-Extra: jinja
Requires-Dist: jinja2>=2.8; extra == "jinja"
Dynamic: license-file

# lucide

Use [Lucide icons](https://lucide.dev/) in your Django and Jinja templates.

> **Fork of [franciscobmacedo/lucide](https://github.com/franciscobmacedo/lucide)** with additional features:
> - Dynamic template attribute rendering (use `{{ variables }}` in attributes)
> - Icon alias support with deprecation warnings (246 aliases)
> - Automatic icon updates via GitHub Actions

## Requirements

Python 3.8 to 3.12 supported.

Django 3.2 to 5.0 supported.

## Installation

```bash
pip install django-lucide
```

## Usage

The `lucide` package supports both Django templates and Jinja templates.

### Django templates

1. Add to your `INSTALLED_APPS`:

    ```python
    INSTALLED_APPS = [
        ...,
        "lucide",
        ...,
    ]
    ```

2. Load the template library in your templates:

    ```django
    {% load lucide %}
    ```

    **Or** make it available globally (no `{% load %}` needed):

    ```python
    TEMPLATES = [
        {
            "BACKEND": "django.template.backends.django.DjangoTemplates",
            # ...
            "OPTIONS": {
                # ...
                "builtins": [
                    "lucide.templatetags.lucide",
                ],
            },
        }
    ]
    ```

3. Use icons:

    ```django
    {% lucide "arrow-down" %}
    {% lucide "arrow-down" size=40 class="mr-4" %}
    {% lucide "arrow-down" stroke_width=1 data_controller="icon" %}
    ```

#### Dynamic attributes

You can use template variables in attributes:

```django
{% lucide "user" class="{{ css_class }}" data-id="{{ user.id }}" %}
```

#### Icon aliases

Old icon names automatically resolve to new names with a deprecation warning:

```django
{% lucide "edit-2" %}  {# Works, but warns to use "pen" instead #}
```

### Jinja templates

1. Add the global function to your environment:

    ```python
    from lucide.jinja import lucide
    from jinja2 import Environment

    env = Environment()
    env.globals.update({"lucide": lucide})
    ```

2. Use icons:

    ```jinja
    {{ lucide("arrow-down") }}
    {{ lucide("arrow-down", size=40, class="mr-4") }}
    ```

## Icon reference

Browse all available icons at [lucide.dev/icons](https://lucide.dev/icons/).

## Acknowledgements

- Original package by [franciscobmacedo](https://github.com/franciscobmacedo/lucide)
- Inspired by [Adam Johnson's heroicons](https://github.com/adamchainz/heroicons)
