Status dot
A small shape that shows a status: online, offline, busy, warning, error or unknown.
Example
<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>import { StatusDot } from '@focsd-dev/react';
export function Example() { return <StatusDot status="online" label-visible></StatusDot>;}<script setup>import '@focsd-dev/components/focsd-status-dot.js';</script>
<template> <focsd-status-dot status="online" label-visible></focsd-status-dot></template>// Add CUSTOM_ELEMENTS_SCHEMA to the component's schemas, then:import '@focsd-dev/components/focsd-status-dot.js';
// template<focsd-status-dot status="online" label-visible></focsd-status-dot><script> import '@focsd-dev/components/focsd-status-dot.js';</script>
<focsd-status-dot status="online" label-visible></focsd-status-dot>API
Attributes
| Attribute | Property | Type | Default |
|---|---|---|---|
status | status | Status | neutral |
label | label | string | — |
label-visible | labelVisible | boolean | false |
pulse | pulse | boolean | false |
CSS parts
Style the inside of the component with ::part(), for example focsd-status-dot::part(base).
| Part | Description |
|---|---|
base | The image: the dot and, with `label-visible`, the label. |
dot | The shape (an SVG). |
label | The 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
labelgoes first and the status stays in the name ("Disk almost full, Warning"), so assistive technology always hears the status. Withoutlabel-visiblethe name is only read. - Unknown statuses fall back to neutral, named "Unknown".
pulseadds 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 animatestransformandopacity.- In forced colors every shape is drawn in the system text color, so the shape alone carries the status.
Ask the docs
Hi, what are you building?
Ask about any component, theming, forms or frameworks. I answer with the right component, a snippet and a link to its docs.