Use lucide in your Django and Jinja templates.
Project description
lucide
Use Lucide icons in your Django and Jinja templates.
Fork of 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
pip install django-lucide
Usage
The lucide package supports both Django templates and Jinja templates.
Django templates
-
Add to your
INSTALLED_APPS:INSTALLED_APPS = [ ..., "lucide", ..., ]
-
Load the template library in your templates:
{% load lucide %}
Or make it available globally (no
{% load %}needed):TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", # ... "OPTIONS": { # ... "builtins": [ "lucide.templatetags.lucide", ], }, } ]
-
Use icons:
{% 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:
{% lucide "user" class="{{ css_class }}" data-id="{{ user.id }}" %}
Icon aliases
Old icon names automatically resolve to new names with a deprecation warning:
{% lucide "edit-2" %} {# Works, but warns to use "pen" instead #}
Jinja templates
-
Add the global function to your environment:
from lucide.jinja import lucide from jinja2 import Environment env = Environment() env.globals.update({"lucide": lucide})
-
Use icons:
{{ lucide("arrow-down") }} {{ lucide("arrow-down", size=40, class="mr-4") }}
Icon reference
Browse all available icons at lucide.dev/icons.
Acknowledgements
- Original package by franciscobmacedo
- Inspired by Adam Johnson's heroicons
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_lucide-1.3.1.tar.gz.
File metadata
- Download URL: django_lucide-1.3.1.tar.gz
- Upload date:
- Size: 424.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
202202f08108e0d134b4444cac21035ea11b059445f05109ce787db60b58005d
|
|
| MD5 |
65fa600dec447ea725e093197f1c0261
|
|
| BLAKE2b-256 |
09c8d45394504e52dfc0878067b4858214c96752db676219b7f8980a66bfcdf2
|
Provenance
The following attestation bundles were made for django_lucide-1.3.1.tar.gz:
Publisher:
main.yml on wilczynskiwm/lucide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_lucide-1.3.1.tar.gz -
Subject digest:
202202f08108e0d134b4444cac21035ea11b059445f05109ce787db60b58005d - Sigstore transparency entry: 913289205
- Sigstore integration time:
-
Permalink:
wilczynskiwm/lucide@3d1a0b3b009dbbe166b41c88b03c000007a078ad -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/wilczynskiwm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@3d1a0b3b009dbbe166b41c88b03c000007a078ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_lucide-1.3.1-py3-none-any.whl.
File metadata
- Download URL: django_lucide-1.3.1-py3-none-any.whl
- Upload date:
- Size: 425.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d4d548637cc15f61f0710619bd86b09b240a89fc6fa3421d422046ef8cc72df
|
|
| MD5 |
892090c327a764763da657abda46d82a
|
|
| BLAKE2b-256 |
88e2d0cb84ac735ee1d85759111547a919b8cdd295d8a5f74b25892a4392b798
|
Provenance
The following attestation bundles were made for django_lucide-1.3.1-py3-none-any.whl:
Publisher:
main.yml on wilczynskiwm/lucide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_lucide-1.3.1-py3-none-any.whl -
Subject digest:
7d4d548637cc15f61f0710619bd86b09b240a89fc6fa3421d422046ef8cc72df - Sigstore transparency entry: 913289225
- Sigstore integration time:
-
Permalink:
wilczynskiwm/lucide@3d1a0b3b009dbbe166b41c88b03c000007a078ad -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/wilczynskiwm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@3d1a0b3b009dbbe166b41c88b03c000007a078ad -
Trigger Event:
push
-
Statement type: