Status Indicator
Style-agnostic status indicator with colored dot and optional label.
Preview
Service running
python
status_indicator(status='running', label='Service running')Usage
views.py
python
from djust import LiveView
from djust.components import StatusIndicator
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = StatusIndicator(status='running', label='Service running')my_template.html
django
{{ component }}Parameters
| Name | Type | Default |
|---|---|---|
| status | str | 'offline' |
| label | str | None | None |
| pulse | bool | False |
| size | str | 'md' |
| custom_class | str | '' |
| **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.status_indicator | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 5 of this component's classes at line 2411, 2517, 2519, 2525, 2526. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_components/components-classes.css | Defines 4 of this component's classes at line 551, 565, 599, 603. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |