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

NameTypeDefault
statusstr'offline'
labelstr | NoneNone
pulseboolFalse
sizestr'md'
custom_classstr''
**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 2411, 2517, 2519, 2525, 2526. 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 551, 565, 599, 603. Override those rules, or the custom properties they read, in a stylesheet loaded after it.