wijjit.elements.display.status_indicator.StatusIndicator

class wijjit.elements.display.status_indicator.StatusIndicator(id=None, classes=None, status='info', label=None, custom_statuses=None, indicator_style='filled')[source]

Status indicator element displaying colored dot with label.

A status indicator shows a colored circle/dot with an optional label to represent various states like success, error, warning, etc. Supports preset statuses and custom user-defined statuses.

Parameters:
  • id (str, optional) – Element identifier

  • status (str, optional) – Status name matching preset or custom status (default: “info”)

  • label (str, optional) – Optional label displayed after indicator

  • custom_statuses (dict, optional) – Custom status definitions mapping name to color string or (color, indicator_char) tuple

  • indicator_style ({"filled", "hollow", "square", "ascii"}, optional) – Indicator character style (default: “filled”)

  • classes (str | list[str] | set[str] | None)

Variables:
  • status (str) – Current status name

  • label (str or None) – Label text

  • indicator_style (str) – Indicator visual style

Notes

This is a display-only element and is not focusable.

Default statuses: - error: red - warning: yellow - success: green - disabled: gray - info: blue - pending: cyan - active: bright_green - inactive: dim

Custom statuses can be registered via: - Constructor: custom_statuses={“custom”: “magenta”} - Runtime: indicator.register_status(“custom”, “magenta”)

__init__(id=None, classes=None, status='info', label=None, custom_statuses=None, indicator_style='filled')[source]
Parameters:
Return type:

None

Methods

__init__([id, classes, status, label, ...])

add_class(class_name)

Add a CSS class to this element.

apply_props(props)

Apply props from a VNode, skipping ephemeral props.

get_ephemeral_state()

Get ephemeral state that should survive reconciliation.

get_hardware_cursor_position()

Absolute screen cell where the hardware terminal cursor should park.

get_height_for_width(width)

Return the height this element needs when laid out at width.

get_intrinsic_size()

Get the intrinsic (preferred) size of the status indicator.

handle_key(key)

Handle a key press.

handle_mouse(event)

Handle a mouse event.

has_class(class_name)

Check if element has a CSS class.

on_blur()

Called when element loses focus.

on_focus()

Called when element gains focus.

on_hover_enter()

Called when mouse enters element.

on_hover_exit()

Called when mouse exits element.

on_mount()

Called when element is first added to the element tree.

on_unmount()

Called when element is removed from the element tree.

on_update(changed_props)

Called when element props are updated during reconciliation.

register_status(name, color[, indicator])

Register a custom status at runtime.

remove_class(class_name)

Remove a CSS class from this element.

render_signature()

Paint memo for the skip-unchanged fast path.

render_to(ctx)

Render status indicator to paint context.

restore_ephemeral_state(state)

Restore ephemeral state after reconciliation.

set_bounds(bounds)

Set the element's screen bounds.

toggle_class(class_name)

Toggle a CSS class on this element.

Attributes

captures_tab

Whether this element wants the Tab key instead of focus movement.

parent_frame

Get the parent Frame if this element is inside a scrollable frame.

status

Get current status.

supports_dynamic_sizing

Whether this element supports dynamic sizing.

property status: str

Get current status.

Returns:

Current status name

Return type:

str

register_status(name, color, indicator=None)[source]

Register a custom status at runtime.

Parameters:
  • name (str) – Status name to register

  • color (str) – Color for the indicator (e.g., “red”, “bright_blue”, “magenta”)

  • indicator (str, optional) – Custom indicator character (defaults to indicator_style setting)

Return type:

None

render_signature()[source]

Paint memo for the skip-unchanged fast path.

Captures the current status, indicator style, label, and the runtime status registry (which drives the indicator color and character), plus the style-affecting state. See wijjit.elements.base.Element.render_signature().

Return type:

Any

render_to(ctx)[source]

Render status indicator to paint context.

Parameters:
  • ctx (PaintContext) – Paint context with buffer, style resolver, and bounds

  • styles (Theme)

  • classes (This element uses the following theme style)

  • status_indicator (-)

  • 'status_indicator.{status}' (-)

  • status_indicator.label (-)

Return type:

None

get_intrinsic_size()[source]

Get the intrinsic (preferred) size of the status indicator.

Returns:

(width, height) based on indicator and label

Return type:

tuple[int, int]