Skip to main content

Ready to use Tailwindcss Heroicons components for Python

Project description

pyheroicons

PyPI version License: MIT Python Versions Package Status CI Build

pyheroicons is a Python library that offers a convenient interface to the Tailwind CSS Heroicons icon set. This library allows developers to easily integrate Heroicons into Python-based web frameworks such as Django, Flask, or FastAPI by generating SVG icon template strings.

Installation

To install pyheroicons, simply use pip:

pip install pyheroicons

Usage

Import heroicon function from pyheroicons and use it to generate icon templates:

from pyheroicons import heroicon

heroicon API

  • name The name of the Heroicon (e.g., "academic-cap").
  • variant The variant of the icon ("outline", "solid", "mini", or "micro").
  • cls Optional. A CSS class to apply to the SVG icon.
  • strokewidth Optional. The stroke width of the icon. Only applicable if the original SVG contains a stroke-width attribute. i.e. Only works for the "outline" variant.

Example usage

icon_svg = heroicon(name="academic-cap", variant="outline", cls="icon-class", strokewidth="2")
print(icon_svg)

Keeping Up-to-Date

pyheroicons aims to stay up-to-date with the Heroicons library. When a new version of Heroicons is released, pyheroicons will also release a corresponding version to ensure compatibility.

pyheroicons Version Heroicons Version
1.0.2 2.1.1

Contributing

Contributions to pyheroicons are welcomed!

License

pyheroicons is released under the MIT License.

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

pyheroicons-1.0.5.tar.gz (186.3 kB view hashes)

Uploaded Source

Built Distribution

pyheroicons-1.0.5-py3-none-any.whl (623.8 kB view hashes)

Uploaded 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