A tiny semantic status indicator: a coloured dot with an optional
label. The generic companion to the domain-specific badges in
PhoenixKitWeb.Components.Core.Badge — for "online/offline",
"connected", "live socket up", "syncing" and every other place a
little coloured circle keeps getting hand-rolled.
Origin: extracted from NordSwitch (device online state, websocket health, account connection state).
Summary
Functions
Renders a status dot, optionally with a label.
Functions
Renders a status dot, optionally with a label.
Examples
<.status_dot variant={:success} label="online" />
<.status_dot variant={:error} label="socket down" size={:sm} />
<.status_dot variant={:info} pulse />
<%!-- boolean convenience for the overwhelmingly common case --%>
<.status_dot up={@device.online} label={if @device.online, do: "online", else: "offline"} />Attributes
variant(:atom) - Semantic colour; overridesupwhen set. Defaults tonil. Must be one of:success,:error,:warning,:info,:neutral, ornil.up(:boolean) - Boolean convenience: true → success, false → error (ignored whenvariantset). Defaults tonil.label(:string) - Optional text next to the dot. Defaults tonil.size(:atom) - Dot size. Defaults to:md. Must be one of:xs,:sm, or:md.pulse(:boolean) - Animate the dot (attention/live state). Defaults tofalse.class(:any) - Extra classes for the wrapper. Defaults tonil.state_label(:string) - Overrides the announced state name. The defaults are generic (upreads "online"/"offline"); anything else — a payment, a job — should say so itself. Defaults tonil.- Global attributes are accepted. Extra attributes for the wrapper (title, data-*, …).