Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-icons-bootstrap-icons

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-icons-bootstrap-icons

Bootstrap Icons renderer for django-icons

  • 1.0.1
  • PyPI
  • Socket score

Maintainers
1

django-icons-bootstrap-icons

This project provides a renderer for Bootstrap Icons utilizing django-icons.

Installation

PyPI

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc