Status Dot¶
A small round dot in a status color, with a text name as its title and its accessible name.
Decision¶
| When | Use |
|---|---|
| Health or state in a row, such as reachable or not | Status Dot. |
| Color alone as the signal | A name with the color. The dot always carries one, and a badge shows the word on screen. See Badge. |
Usage¶
import { createStatusDot } from './configurationpage?name=myplugin_stolon.js';
cell.appendChild(createStatusDot({ color: 'green', label: 'Reachable' }).element);
Class: stolon-dot. The handle is { element, getValue, setValue, destroy }.
States and Modifiers¶
colorisgreen,red,orange,purple,blue,gray(default),yellow,pink,teal, or a hex code such as#e91e63. Any other value draws gray.labeldefaults to the meaning of the color: "Active" for green, "Error" for red, "Waiting" for orange, "Working" for purple, "Info" for blue, "Off" for gray, and "Note" for the rest.getValue()returns{ color, label }as drawn, andsetValue({ color, label })redraws it.- The dot has
role="img", and a title andaria-label. - The Sortable Card List draws its card dots as this dot.
Reference¶
Generated from the code by scripts/build-docs.mjs. Edit the code, not this section.
createStatusDot¶
function createStatusDot(options?: StatusDotOptions): StatusDotHandle
A small round dot in a status color with a text name for it, as a title and as the accessible name.
| Option | Type | What it does |
|---|---|---|
color |
'green' | 'red' | 'orange' | 'purple' | 'blue' | 'gray' | 'yellow' | 'pink' | 'teal' | string |
'green', 'red', 'orange', 'purple', 'blue', 'gray', 'yellow', 'pink', 'teal', or a hex code such as '#e91e63' (default 'gray') |
label |
string |
the name of the state (default the color's meaning, such as 'Active' for green) |
| Handle member | Type |
|---|---|
getValue |
(): { color: string; label: string; } |
setValue |
(next: StatusDotOptions): void |
destroy |
(): void |
| Class | What it looks like |
|---|---|
stolon-dot |
Small round dot in a status color, which needs a title and an aria-label |
Example¶
Example Code¶
<!-- title: Status Dot -->
<div id="mount"></div>
<script type="module">
const base = await window.__baseReady;
const view = document.getElementById('view');
const mount = document.getElementById('mount');
mount.style.cssText = 'display:flex;align-items:center;gap:12px';
['green', 'red', 'orange', 'purple', 'blue', 'gray'].forEach((color) => mount.appendChild(base.createStatusDot({ color }).element));
</script>