Skip to main content

Django Lucide Icons

Project description

Django Lucide Icons

This is a Django template tag that allows you to use Lucide Icons in your Django templates.

Installation

To install the package, simply run:

pip install django-lucide-icons

Then add

INSTALLED_APPS = [
    # ...
    "lucide_icons",
]

to your Django project's settings.py file.

Usage

To use the template tag, add the following line to your Django project's settings.py file:

LUCIDE_ICONS_DIR = "/path/to/your/icons/directory"

The LUCIDE_ICONS_DIR variable should be set to the directory where you want to store the Lucide icons.

Then, you can use the lucide template tag in your Django templates to display Lucide icons. For example, to display the "home" icon, you can use the following code:

{% load lucide_tags %} 

{% lucide "home" %}

The lucide template tag takes a single argument, which is the name of the Lucide icon you want to display. It returns the SVG code of the icon as a string.

Since the plain SVG is rendered, it might make sense to wrap it in a "span" or "div" element to size it properly. Alternative approaches are welcome. Just submit an issue or a pull request.

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

django_lucide_icons-0.1.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

django_lucide_icons-0.1.1-py2.py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page