Progress Circle
Style-agnostic circular progress indicator using SVG stroke-dasharray.
Preview
Arguments
progress_circle(value=75)
Arguments
progress_circle(value=33, color='warning')
Usage
views.py
python
from djust import LiveView
from djust.components import ProgressCircle
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = ProgressCircle(value=75)my_template.html
django
{{ component }}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| value | int | 0 | Progress percentage (0-100) |
| size | str | 'md' | Size variant (sm, md, lg) |
| color | str | 'primary' | Color variant (primary, success, warning, danger) |
| show_value | bool | True | Whether to display percentage text (default: True) |
| custom_class | str | '' | Additional CSS classes |
| **kwargs | — passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state | — | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.progress_circle | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 7 of this component's classes at line 2550, 2577, 2579, 2584, 2587, 2589. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_components/components-classes.css | Defines 5 of this component's classes at line 517, 523, 527, 536, 544. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |