django-icons-bootstrap-icons
This project provides a renderer for Bootstrap Icons utilizing django-icons.
Installation
Just run:
pip install django-icons-bootstrap-icons
To use
In your settings.py file:
DJANGO_ICONS = {
"DEFAULT": {
"renderer": "django_icons_bootstrap_icons.BootstrapIconRenderer"
}
}
Then just use the {% icon %} tag as normal!
Extra features
This renderer includes a very neat feature over the default IconRenderer, which is support for custom attributes.
For instance, to add an aria-label to your icon, you can do the following:
{% icon "person" aria_label="person icon" %}
Note that while attributes in HTML are -, separated, this isn't possible in Django templates due to Python. Therefore, write the keys with _ instead, and the renderer will autoconvert them for you.
This also works with attributes that do not have -es in them, such as tabindex.
Aside from this, BootstrapIconRenderer supports all features of the default renderer as it is just a superclass of IconRenderer.
Contributing
I welcome all contributions! Just fork and then send a PR.
License
This work is licensed under the MIT license.
Release files for django-icons-bootstrap-icons 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_icons_bootstrap_icons-1.0.1.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_icons_bootstrap_icons-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / django_icons_bootstrap_icons-1.0.1.tar.gz
| Download URL | django_icons_bootstrap_icons-1.0.1.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10db76b6756e7eac9ddd857f3af3c66f9779856e255cb2dc9d2871f3568a0c14
|
|
BLAKE2b-256 checksum How to use checksums |
06b959373d8d6b35f3b44f54fd10bc7b140d14db58da66f1f30944829acff500
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / django_icons_bootstrap_icons-1.0.1-py3-none-any.whl
| Download URL | django_icons_bootstrap_icons-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7423689bc4c7c820dc2f85e7c9c0a5528feedcf636620eeb5eb9a801f4af8287
|
|
BLAKE2b-256 checksum How to use checksums |
06afeb41273b1e9abd431113aedfddefdbbbf9945fa9a13ed07a368618c94c22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|