Status Indicator

Style-agnostic status indicator with colored dot and optional label.

python 6 params

Preview

status
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

NameTypeDefaultDescription
statusstr'offline'Status string (online, degraded, offline, maintenance)
labelstr | NoneNoneOptional label text
pulseboolFalseWhether to animate with pulse (default: False)
sizestr'md'Size variant (sm, md, lg)
custom_classstr''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
FilePathNotes
moduledjust.components.components.status_indicatorSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 5 of this component's classes at line 2514, 2620, 2622, 2628, 2629. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_components/components-classes.cssDefines 4 of this component's classes at line 553, 567, 601, 605. Override those rules, or the custom properties they read, in a stylesheet loaded after it.