Phosphor Icons as django-components
Project description
djc-phosphor-icons
Phosphor Icons as django-components.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
030e8cdfda9979155d65bc939be4068fc7c9ba32f57a01c65cb68d44f9d7f4ef
|
|
| MD5 |
4286e48c95ae1bd7f20a23979cade65b
|
|
| BLAKE2b-256 |
46fc5fafc1a80e2a4c8c6afaa0f00e82660e130cbc116418a614706b6c7b4b9c
|
Provenance
The following attestation bundles were made for djc_phosphor_icons-0.0.2.tar.gz:
Publisher:
publish.yml on joeyjurjens/djc-phosphor-icons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
djc_phosphor_icons-0.0.2.tar.gz -
Subject digest:
030e8cdfda9979155d65bc939be4068fc7c9ba32f57a01c65cb68d44f9d7f4ef - Sigstore transparency entry: 1924597860
- Sigstore integration time:
-
Permalink:
joeyjurjens/djc-phosphor-icons@5994da6dc6494d3d12bf4c1cf5c1b105853a0a08 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/joeyjurjens
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5994da6dc6494d3d12bf4c1cf5c1b105853a0a08 -
Trigger Event:
release
-
Statement type:
File details
Details for the file djc_phosphor_icons-0.0.2-py3-none-any.whl.
File metadata
- Download URL: djc_phosphor_icons-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9181857e30d75be1508406fdf21655ce934720ac5ff7c1c01970409c6bbee892
|
|
| MD5 |
51f00ff38def50abab80ce375a476d5d
|
|
| BLAKE2b-256 |
5076dda93480ce1e33c8aed842349d428139a41e855850a027f39d9514925daa
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
djc_phosphor_icons-0.0.2-py3-none-any.whl -
Subject digest:
9181857e30d75be1508406fdf21655ce934720ac5ff7c1c01970409c6bbee892 - Sigstore transparency entry: 1924597938
- Sigstore integration time:
-
Permalink:
joeyjurjens/djc-phosphor-icons@5994da6dc6494d3d12bf4c1cf5c1b105853a0a08 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/joeyjurjens
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5994da6dc6494d3d12bf4c1cf5c1b105853a0a08 -
Trigger Event:
release
-
Statement type: