Skip to content
Focsd homeFocsd homeFocsd
Forms

Status dot

A small shape that shows a status: online, offline, busy, warning, error or unknown.

  • Tag: focsd-status-dot
  • Pattern: Image (role=img): a shape per status, named by its label
  • Category: Display

Example

HTML
<div class="stack">
<focsd-status-dot status="online" label-visible></focsd-status-dot>
<focsd-status-dot status="busy" label-visible></focsd-status-dot>
<focsd-status-dot
status="warning"
label="Disk almost full"
label-visible></focsd-status-dot>
<focsd-status-dot status="error" label-visible></focsd-status-dot>
<focsd-status-dot status="offline" label-visible></focsd-status-dot>
<focsd-status-dot status="neutral" label-visible></focsd-status-dot>
</div>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-status-dot.js';
</script>
<focsd-status-dot status="online" label-visible></focsd-status-dot>

API

Attributes

AttributePropertyTypeDefault
statusstatusStatusneutral
labellabelstring—
label-visiblelabelVisiblebooleanfalse
pulsepulsebooleanfalse

CSS parts

Style the inside of the component with ::part(), for example focsd-status-dot::part(base).

PartDescription
baseThe image: the dot and, with `label-visible`, the label.
dotThe shape (an SVG).
labelThe visible label (with `label-visible`).

Accessibility

  • Every status has its own shape (filled, ring, bar, triangle, cross, dash) as well as its own color, so it works in grayscale and for color-blind readers.
  • It is an image named by its status ("Online"). A custom label goes first and the status stays in the name ("Disk almost full, Warning"), so assistive technology always hears the status. Without label-visible the name is only read.
  • Unknown statuses fall back to neutral, named "Unknown".
  • pulse adds a slow halo to an online dot. It beats twice (about 4 seconds) and stops, so it never runs for more than 5 seconds. It is hidden under reduced motion and in forced colors, and it only animates transform and opacity.
  • In forced colors every shape is drawn in the system text color, so the shape alone carries the status.