Skip to main content

Phosphor Icons as django-components

Project description

djc-phosphor-icons

Phosphor Icons as django-components.

Browse all icons →

Installation

pip install djc-phosphor-icons

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "django_components",
    "djc_phosphor_icons",
]

Usage

{% component "Icon" name="house" / %}
{% component "Icon" name="house" weight="bold" / %}
{% component "Icon" name="house" style="stroke" size=24 color="#ff0000" / %}
Kwarg Type Default Description
name str Icon name, e.g. "house"
weight str "regular" bold, duotone, fill, light, regular, thin
style str "flat" flat or stroke
size int None Sets width and height in px
color str None Sets CSS color
mirrored bool False Flips the icon horizontally
attrs dict None Extra attributes passed to the <svg> element

Settings

Configure via PHOSPHOR_ICONS in your Django settings:

PHOSPHOR_ICONS = {
    "auto_register": True,        # Auto-register the component on startup (default: True)
    "component_name": "Icon",     # Template tag name (default: "Icon")
    "default_style": "flat",      # Default style (default: "flat")
    "default_weight": "regular",   # Default weight (default: "regular")
    "cache": True,                # Cache rendered output per unique set of kwargs (default: True)
}

Development

uv sync
uv run pytest
uv run ruff check .
uv run ruff format .

To update the icon set to a specific Phosphor release (for local inspection only — the update-icons GitHub Action handles this automatically when committing):

uv run python scripts/download_icons.py v2.1.0

To generate a visual preview of all icons:

uv run python scripts/preview_icons.py

Known Icon Issues

The following icons are incomplete in the upstream Phosphor release and will fail to render in certain combinations:

  • book-user: missing from stroke/light, stroke/bold, stroke/fill, stroke/duotone

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

djc_phosphor_icons-0.0.2.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djc_phosphor_icons-0.0.2-py3-none-any.whl (9.1 MB view details)

Uploaded Python 3

File details

Details for the file djc_phosphor_icons-0.0.2.tar.gz.

File metadata

  • Download URL: djc_phosphor_icons-0.0.2.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djc_phosphor_icons-0.0.2.tar.gz
Algorithm Hash digest
SHA256 030e8cdfda9979155d65bc939be4068fc7c9ba32f57a01c65cb68d44f9d7f4ef
MD5 4286e48c95ae1bd7f20a23979cade65b
BLAKE2b-256 46fc5fafc1a80e2a4c8c6afaa0f00e82660e130cbc116418a614706b6c7b4b9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for djc_phosphor_icons-0.0.2.tar.gz:

Publisher: publish.yml on joeyjurjens/djc-phosphor-icons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djc_phosphor_icons-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for djc_phosphor_icons-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9181857e30d75be1508406fdf21655ce934720ac5ff7c1c01970409c6bbee892
MD5 51f00ff38def50abab80ce375a476d5d
BLAKE2b-256 5076dda93480ce1e33c8aed842349d428139a41e855850a027f39d9514925daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for djc_phosphor_icons-0.0.2-py3-none-any.whl:

Publisher: publish.yml on joeyjurjens/djc-phosphor-icons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page