A package to provide popular icon packs for use with Django Cotton. Currently, Heroicons and Tabler Icons are supported.
- Heroicons:
v2.1.5
- Tabler Icons:
v3.34.0
1. Install from pypi
pip install cotton-icons
2. Install into your django project
# settings.py
INSTALLED_APPS = [
'cotton_icons'
]
3. Use in template
Heroicons:
<c-heroicon.[kebab-case heroicon name] variant="outline|solid|mini" [any other attribute will pass to the <svg> tag] />
Tabler Icons:
<c-tablericon.[kebab-case tabler icon name] variant="outline|filled" [any other attribute will pass to the <svg> tag] />
variant
defaults tooutline
- for outline variant, you can also pass
stroke-width="" stroke-linecap="" stroke-linejoin=""
Examples:
<c-heroicon.chevron-down class="size-5" /> <!-- default variant "outline" -->
<c-heroicon.chevron-down variant="solid" class="size-5" />
<c-heroicon.chevron-down variant="mini" class="size-5" />
<c-tablericon.graph class="size-5" /> <!-- default variant "outline" -->
<c-tablericon.graph variant="filled" class="size-5" />
- Add Tabler Icons