Skip to main content

Django SVG Icons made easy

Project description

Django SVG Icons
================

Simple django templatetag to display `SVG` icons in your django application.
Icon paths will loaded from a provided `JSON` file, formatted according the icomoon format.

More info: [Icomoon website](http://icomoon.io/)


Installation
------------

Installation from pypi via pip

pip install django-svg-icons


Configuration
-------------

In your django project add `svg_icons` to your installed apps and set the `SVG_ICONS_SOURCE_FILE` setting to your source file.

INSTALLED_APPS = [
# ...
'svg_icons',
]

SVG_ICONS_SOURCE_FILE = '/path/to/source_file.json'


Usage
-----

In your templates you can load the templatetag and start including your icons.

{% load svg_icons %}
{% icon 'icon_name' %}

The templatetag accepts some kwargs for icon configuration as well.

- **size** for setting both width and height
- **width** for only setting a specific width
- **height** for only setting a specific height
- **className** css classnames applied on the `<svg>` object

All kwargs are optional, when not provided the deaults are used.

{% icon 'icon_name' size=50 className="css classnames" %}


Todo
----

- Write tests

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-svg-icons-0.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

django_svg_icons-0.1.2-py2-none-any.whl (6.5 kB view details)

Uploaded Python 2

File details

Details for the file django-svg-icons-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-svg-icons-0.1.2.tar.gz
Algorithm Hash digest
SHA256 de048d4cba49d0e30ed3412e1b4b9e29c6dcda03d0fce0c567ea4c155e7f7b6c
MD5 07f08e51d47b1839194b1f6a4856c8bb
BLAKE2b-256 f486d03d1d40e963422547c13dc22a488a08f681a30299f4c21c5402d1196e63

See more details on using hashes here.

File details

Details for the file django_svg_icons-0.1.2-py2-none-any.whl.

File metadata

File hashes

Hashes for django_svg_icons-0.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 ea9cb3ae499bcecb973ec596a84584d4f9b12dd2ea8612134d4e6a6cf4c07d0c
MD5 079604b5f0647e99939ad4a09a405cfa
BLAKE2b-256 7108295fa4132e85d449aa229bd5a65ba38d16efefc6d904d9169998be1aabc9

See more details on using hashes here.

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