Use heroicons in your Django and Jinja templates
heroicons
Use heroicons in your Django and Jinja templates.
Requirements
Python 3.6 to 3.9 supported.
Django 2.2 to 3.2 supported.
Are your tests slow? Check out my book Speed Up Your Django Tests which covers loads of best practices so you can write faster, more accurate tests.
Usage
The heroicons
package supports both Django templates and Jinja templates. Follow the appropriate guide below.
Django templates
-
Install with
python -m pip install heroicons[django]
. -
Add to your
INSTALLED_APPS
:INSTALLED_APPS = [ ..., "heroicons", ..., ]
Now in your templates you can load the template library with:
{% load heroicons %}
This provides two tags to render SVG icons: heroicon_outline
and heroicon_solid
, corresponding to the two icon styles